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

  1. CALOok (continued):
  2.  
  3.         Sometimes a conditional prompt is likely to occur several
  4. times in succession before the BBS finally gets to the prompt you're
  5. really looking for.  The most common example of this phenomenon is
  6. with "Press Any Key To Continue" type prompts.  For example, a BBS
  7. might have several opening screens which contain things like News
  8. Bulletins or Advertisements..whatever.  It's not always possible to
  9. account for how many of these prompts *precisely* will come in.  This
  10. segment of the flowchart illustrates the processing cycle:
  11.  
  12.                   ┌───────v──────┐ Yes             ┌─────────┐
  13.                   │"More" Prompt?├─────────────────>Send CR  │
  14.                   └───────┬──────┘<┐               └────┬────┘
  15.                      No   │        └────────────────────┘
  16.  
  17.         Notice how the flow after "Send CR" goes right back to the
  18. "More Prompt?" handler, rather than continuing to the next even in
  19. the chain?  Coninuing with the {:LOGIN} segment:
  20.  
  21. {:LOGIN}
  22.      {CALO mprompt,sendesc,Press <ESC> key}
  23.  {:MPROMPT}                           <───┐
  24.      {CALO mprompt,send_cr,More?}         │   loops back to the
  25.      {LOOK First Name?}                   │   "More Prompt?" handler
  26. .                                         │    since the CALOok
  27. .                                         │    statement points to
  28. .                                         │    this location as the
  29. {:SENDESC}                                │    "return" point
  30.      {SEND ^[}                            │
  31.      {RETU}                               │
  32. {:SEND_CR}                                │
  33.      {SEND |}                             │
  34.      {RETU}          ─────────────────────┘
  35.  
  36. Here's something for you to ponder:  In the above example, I
  37. specified a separate macro ID of "mrprompt" that I use as a place
  38. holder or marker, if you will.  Look at the following alternative for
  39. the first 5 lines in the example above:
  40.  
  41. {:LOGIN}
  42.      {CALO login,sendesc,Press <ESC> key}
  43.      {CALO login,send_cr,More?}
  44.      {LOOK First Name?}
  45.  
  46. Do you see how I've been able to eliminate a couple bytes (the
  47. "mprompt" macro ID) by "piggy-backing" on an already existing label?
  48.  
  49. (Continued in Lesson 5d)
  50.  
  51. Jim
  52.