Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

waitfor

Status
Not open for further replies.

flea333

Technical User
Sep 4, 2003
47
US
I'm sending a transmit string, then after each time I use waitfor to ensure I receive what I want. Well the waitfor doesn't seem to want to work after about 10 or so of them. It just skips right on ahead. I know my data is coming in as the waitfor statement has it. What could be the problems?
 
I added some rxflush's every couple lines and that seemed to do the trick. I've never had to do that before..but then again I probably never used the waitfor with so much text. I don't know exactly how that waitfor stuff works, I thought it just read the data buffer and looked for your string, I dont see why I would have to use rxflush. Anybody have some insight?
 
One thing to keep in mind about the waitfor command is that it only waits 30 seconds for the specified string to appear. If it doesn't show up, then the waitfor command exits, reports failure, and the script goes on to the next command. You can add a number at the end of the waitfor command specifying how long the waitfor command should look for the string.

I also recommend making the strings as short as possible so you don't have to worry about line noise or other glitches corrupting part of the string.


aspect@aspectscripting.com
 
You might also add FOREVER to the end of the statement:
waitfor "string you are waiting for" FOREVER
This will make it wait longer than 30 seconds, forever. You can also change FOREVER to an integer and Procomm will wait that number of seconds before going on. If you specify nothing, it waits 30 seconds by default.

What is a rxflush?
 
Here is the example of rxflush from the ASPECT help file:

Clears the receive data buffer. Any characters that have been received but not processed or displayed will be lost when rxflush executes.

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top