home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / jbtutor1.zip / LESSON7.TXT < prev    next >
Text File  |  1993-09-19  |  1KB  |  45 lines

  1. GOLOok:
  2.  
  3. Syntax:
  4.  
  5.         {GOLO name,string}
  6.                │    │
  7.                │    └─────> target string
  8.                │
  9.                └────────> macro id to goto upon receipt of string
  10.  
  11.         This command is very much like CALOok in that a branch will
  12. occur to a separate macro command upon receipt of a target string.
  13. Unlike CALOok, though, a RETUrn point is not specified.  After the
  14. macro specified by the GOLOok is executed, you must manually point to
  15. the next macro to process.
  16.  
  17.         Personally, I find GOLOok most useful for handling unexpected
  18. "NO CARRIER"s.  For example:
  19.  
  20. {:ANYID}
  21.      {SSLO ss_|,More?}
  22.      {GOLO goodbye,^jNO CARRIER^m}
  23.      {LOOK anyprompt}
  24. .
  25. .
  26. .
  27. {:GOODBYE}
  28.      {HANG y}
  29.      {GOTO dial}
  30. ----------------
  31.         In this example, the script will run one course if the
  32. session goes according to plan..it will run another course if CARRIER
  33. is lost unexpectedly while it's waiting for the "anyprompt".
  34.  
  35.         Generally, the use of a "GOLOok" will result in the use of
  36. "GOTO" (or equivalent) somewhere after the macro pointed to by
  37. "GOLOok" is executed.  I was taught that "GOTO" statements are the
  38. devil incarnate in programs <g> (they tend to contribute to that
  39. awful phenomenon know as "spaghetti code"), so I try to avoid using
  40. them as much as possible.  As a result, I don't use many GOLOoks
  41. either, but I do find them useful in a couple cases, similar to that
  42. mentioned above.
  43.  
  44. Jim
  45.