Script TRYAGAIN Statement

TRYAGAIN n [TIMES] [ [THEN] block]

The TRYAGAIN statement is part of a WAIT block and is used to repeat the previous SEND statement a specified number of times.

This statement works only in the context of the SEND-WAIT statement pair. It repeats the previous SEND up to n times. After the nth attempt, processing either performs the THEN block or EXITs.

For example:

SEND "ATDT 555-1212"
WAIT
  FOR "CONNECT" CONTINUE
  FOR "NO CARRIER" EXIT
  FOR 5 SECONDS
  TRYAGAIN 5 TIMES THEN GOTO @failed

This script sends the phone number and waits five seconds for either CONNECT or NO CARRIER. If the response is not received, the phone number is sent up to five more times. If the expected response is still not received, the process jumps to the @failed label.

Copyright © 2017 American Chemical Society. All Rights Reserved.