Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The enviroment is simple, natural and efficient. The members are competent, educated and professionals..."

Geography

Where in the world do Tek-Tips members come from?

How do I create a loop to poll, exiting once correct text prints out?

rdp3678 (TechnicalUser)
1 Jul 11 14:23
How do I create a loop to poll, exiting once correct text prints out from a "transmit" command?
knob (Programmer)
1 Jul 11 20:26
Can you give us a little more details?  Usually you would use the waitfor command (might need to specify a timeout longer than the default 30 seconds) or when target.

http://www.aspectscripting.com

rdp3678 (TechnicalUser)
1 Jul 11 21:07
I'm loading software but it doesn't reply when it's complete. I need to query the unit periodically with a get_status command to find whether it's in progress or complete. The 2 different responses:

DownloadInProgress
OperationSucceeded

DownloadCompleted
OperationSucceeded

Once I get the completed message I want to script to continue with the software activation. Suggestions? Thanks for your time.
knob (Programmer)
3 Jul 11 2:08
Check out the script at the link below:

http://www.aspectscripting.com/WaitList.was

It came from another forum user and has been pretty handy over the years.  Basically it wraps up to three when statements into a single function and returns which of the (up to) three strings was received, if any.

http://www.aspectscripting.com

rdp3678 (TechnicalUser)
8 Jul 11 11:20
Thanks Knob, but I'm still having an issue with this script. How do I pass the first line of the response thru the waitlist function? I feel that the second line "OperationSucceeded" is only being passed.
knob (Programmer)
8 Jul 11 12:47
Can you post what the call to the WaitList funcation in your script looks like?

http://www.aspectscripting.com

rdp3678 (TechnicalUser)
12 Jul 11 8:40
Here is how I'm trying to call it:

while SUCCESS
                        pause 15
                        transmit "getswsessionstatus 1^M"
                        WaitList(30, "DownloadInProgress", "DownloadCompleted", $NULLSTR)
                              if WaitListStat == 1
                                   SUCCESS
                              elseif WaitListStat == 2
                                   FAILURE
                              elseif WaitListStat == 3
                                   FAILURE
                              elseif WaitListStat == 0
                                   FAILURE
                              endif
                    endwhile

I'm new to aspect programming and very rusty with C so any help would be appreciated.
knob (Programmer)
14 Jul 11 11:46
OK, I think the problem is that you're trying to set a value for success/failure in your script and then likely trying to check for that value just after this code in your script.  Only ASPECT (and only using certain commands) can set success or failure.  What you can do instead is move the appropriate commands into the appropriate if clauses in your script.

http://www.aspectscripting.com

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close