100
V
ERSION
VERSION
Returns the version number of Comms.
W
AIT
WAIT <value>
E
NDWAIT
<string exp> GOTO <label>
<string exp> GOTO <label>
…
ENDWAIT
Pauses the script for a given number of half-seconds, and waits for one of
several strings. E.g.
WAIT 10
“No carrier” GOTO tryagain
“Hangup” GOTO closeconn
ENDWAIT
SEND “ATDT91011992220”
pauses for 5 seconds before proceeding with the next command in the
script (‘
SEND
’). If, during that time, the MC 218 receives “
No carrier
”
from the remote machine, it will carry out the ‘
GOTO tryagain
’
command. Similarly, if the MC 218 receives “
Hangup
” during the 5
seconds, the script will jump to the ‘
closeconn
’ label.
WAIT
requires a
matching
ENDWAIT
command.
W
HILE
WHILE <exp> DO
D
O
…
E
NDWHILE
ENDWHILE
Carries out a given command while a certain condition is met. E.g.
WHILE R$<>“OK” DO
SEND “AT”
ENDWHILE
sends the “
AT
” string as long as
R$
is not equal to “
OK
”.
Note: The important difference between REPEAT…UNTIL loops and
WHILE…DO…ENDWHILE loops is that REPEAT…UNTIL always
executes the specified action at least once, and ceases to do so when a
condition is met. By contrast, WHILE…DO…ENDWHILE checks for a
condition before ever carrying out an action, so if the condition is not met, the
action will not be executed at all.