home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
jbtutor1.zip
/
LESSON7.TXT
< prev
next >
Wrap
Text File
|
1993-09-19
|
1KB
|
45 lines
GOLOok:
Syntax:
{GOLO name,string}
│ │
│ └─────> target string
│
└────────> macro id to goto upon receipt of string
This command is very much like CALOok in that a branch will
occur to a separate macro command upon receipt of a target string.
Unlike CALOok, though, a RETUrn point is not specified. After the
macro specified by the GOLOok is executed, you must manually point to
the next macro to process.
Personally, I find GOLOok most useful for handling unexpected
"NO CARRIER"s. For example:
{:ANYID}
{SSLO ss_|,More?}
{GOLO goodbye,^jNO CARRIER^m}
{LOOK anyprompt}
.
.
.
{:GOODBYE}
{HANG y}
{GOTO dial}
----------------
In this example, the script will run one course if the
session goes according to plan..it will run another course if CARRIER
is lost unexpectedly while it's waiting for the "anyprompt".
Generally, the use of a "GOLOok" will result in the use of
"GOTO" (or equivalent) somewhere after the macro pointed to by
"GOLOok" is executed. I was taught that "GOTO" statements are the
devil incarnate in programs <g> (they tend to contribute to that
awful phenomenon know as "spaghetti code"), so I try to avoid using
them as much as possible. As a result, I don't use many GOLOoks
either, but I do find them useful in a couple cases, similar to that
mentioned above.
Jim