The commands described in this section are all related to
the simple tasks of sending strings of data to your modem
and then waiting for a response.

Sometimes, the data sent will constitute a command to your
modem to perform some action. More often, the modem will
be required to transmit the data to the remote computer.

In either case, YOUR computer simply sends a string and
then waits for a reply.

Scripta in fact allows you to SEND and WAIT as separate
commands but more often than not you will use the command
SENDWAIT to perform both as a single action.

The SEND Command
~~~~~~~~~~~~~~~~
SEND <string>

Transmits <string> to the modem and then continues
immediately with the command following the SEND command.

The WAIT Command
~~~~~~~~~~~~~~~~
WAIT[/<time_limit>] <string1> [...<string10>]

Waits up to a maximum of <time_limit> seconds for any of
up to ten different strings to be received from the modem
(usually having been sent originally by the remote
computer.

If <time_limit> is omitted then the WAIT command will wait
forever until one of the strings is received.

The WAIT command sets the variable %HAD to zero if it
timed out or to a value in the range 1 to 10 indicating
which of the strings was received.

The value of this variable may be tested with statements
such as

   IF HAD n
or IF %HAD = n

The SENDWAIT Command
~~~~~~~~~~~~~~~~~~~~
SENDWAIT[/<time_limit>] <string0> <string1> [... <string10> ]

This command is EXACTLY equivalent to the two commands

SEND <string0>
WAIT[/<time_limit>] <string1> [... <string10> ]

except that no delay occurs between the SEND and the WAIT
thus eliminating the possibility of incoming data being
missed. In fact, the two commands placed together like
this would work just as well. The temptation, however, is
to insert other commands between the SEND and the WAIT,
with the possibility that such commands will not be
completed in time for the response to be received from the
remote computer.

For safety, use SENDWAIT in preference to two separate
commands whenever possible.

HAD and %HAD may be used exactly as described for the WAIT
command.

The DIAL Command
~~~~~~~~~~~~~~~~
DIAL[/<time_limit>] <string1> [... <string10> ]

The DIAL command is really a special form of SENDWAIT
where you can specify up to ten different strings to be
sent (each of which is a telephone number) and by
implication, Scripta will wait for one of the responses
CONNECT, BUSY, NO CARRIER, NO DIAL TONE or VOICE.

These have the standard '%HAD' values of 1 to 5 although
in practice you will never have to test for them. %HAD=11
is used for time-out and %HAD=6 or 7 are used for user
cancellation (by pressing the Esc key). Again, in
practice, you need never be aware of these values as they
are handled automatically by Scripta.

If more than one telephone number is supplied then they
will each be dialled in turn until a connection is made.

If no connection is made, processing continues with the
command following the DIAL command.

The success or failure of the DIAL command may be tested
with commands of the form

   IF [NOT] [UN]CONNECTED
or IF %[NO]CONN 

In fact, the most common usage is:

While not connected
   Dial <number1> [... <number10> ]
EndWhile

If a connection is made successfully, then %HAD is set to
indicate to which of the numbers the connection was made.
Again, this is usually of little interest and is handled
by Scripta.

The %CONN and %NOCONN variables are provided so that connection may
be tested within a larger expression. For example,

IF %CONN & ((%HAD=2) | (%HAD=3))

Whenever a script is running, the Tab key may be pressed
to tell Scripta to move on immediately to the next
command. Therefore, if the following format is used

While not connected
   Dial <number1>
   Dial <number2>
   Dial <number3>
EndWhile

then the Tab key may be used to move on to the next number in
sequence without waiting for the expiry of any
<time_limit> which may have been specified for the current
number.

Note that <time_limit>, if supplied, is applied to each
number in the DIAL command.

When the modem is already connected to a remote service,
the DIAL command has a null action. i.e., Scripta moves
straight on to the next command in sequence.

The HANGUP Command
~~~~~~~~~~~~~~~~~~
HANGUP

This is another special form of SENDWAIT in which the
string to be sent is the Hangup string which you have set
up previously in Scripta Configuration. Scripta accepts
any response from the modem and does not set %HAD.
