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

  1. CALOOK:
  2.  
  3.         I'm going to use the following piece of the previous
  4. flowchart to illustrate the use of CALOok:
  5.  
  6.                             LOGIN PROCESS
  7.  
  8.                  ┌─────────────────┐ Yes           ┌─────────┐
  9.                  │ Mailer Running? ├───────────────>Send ESC │
  10.                  └────────┬────────┘               └─────┬───┘
  11.                      No   │<─────────────────────────────┘
  12.  
  13.         Sometimes there will be prompts that might occur, and then
  14. again, might not occur.  In cases like this, you can't use {LOOK}
  15. because the script will hang if the LOOKed for text does not come in
  16. from the BBS.  For these cases, you need a CONDITIONAL "look".
  17. There are three such "conditional" LOOK statements available in the
  18. {COMMO} macro language -- CALOok, GOLOok, and SSLOok.
  19.  
  20.         Building on previous lessons, let's give our "login"
  21. subroutine its own Macro ID (name)..let's call it "{:LOGIN}
  22.  
  23. {:LOGIN}
  24.      {CALO mprompt,sendesc,Press <ESC> key to continue}
  25. {:MPROMPT}
  26.      {LOOK What is your REAL first name?}
  27.  
  28.         This segment adds a conditional check for a mailer's prompt
  29. to press the "Escape" key.  If the mailer prompt is received, the
  30. CALOok statement will interrupt regular script processing to execute
  31. the macro I've named "sendesc" ({:SENDESC}).  After executing that
  32. macro in response to the "Press Escape" prompt, the script will
  33. return to the point I've specified in the CALOok statement, which in
  34. this case, is "mprompt" ({:MPROMPT}).  If the "Press esc" prompt is NOT
  35. received, the script continues on its merry way which, according to
  36. the example is to LOOK for a "first name" prompt.  Here's what
  37. {:SENDESC} might look like:
  38.  
  39. {:SENDESC}
  40.      {SEND ^[}          (Note the use of "^[" to signify the "escape"
  41.      {RETU}              character)
  42.  
  43.  
  44. Continued in Lesson 5c..
  45.  
  46. Jim
  47.