home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / jbtutor1.zip / LESSON6.TXT < prev    next >
Text File  |  1993-06-20  |  3KB  |  87 lines

  1. SSLOok:
  2.  
  3.         SSLOok is another conditional "look" command.  It can be used
  4. in lieu of CALOok.  SSLOok is most useful for handling prompts that
  5. will appear more than once on a BBS..for example "Press Any Key To
  6. Continue" prompts.  However, SSLOok may be used to handle *any*
  7. prompt you'd like to apply it to.
  8.  
  9.         If you've been reading the macro docs, you know that SSLOok
  10. sends the value of a string variable that you've previously set.
  11. Using the mailrun macro we've been working on as an example, SSLOok
  12. could be used as a substitute for the CALOok statement in the
  13. following way:
  14.  
  15. OLD METHOD USING CALOok:
  16.  
  17. {:LOGIN}
  18.      {CALO login,sendesc,Press <ESC> key}
  19.      {CALO login,send_cr,More?}
  20.      {LOOK first name?}  {SEND Jim|}
  21. .
  22. .
  23. {:SENDCR}
  24.      {SEND |}{RETURN}
  25. ----------
  26.  
  27. NEW METHOD USING SSLOok:
  28.  
  29. {:LOGIN}
  30.      {CALO login,sendesc,Press <ESC> key}
  31.      {SSLO ss_|,More?}
  32.      {LOOK first name?}  {SEND Jim|}
  33. .
  34. .
  35. (macro id "sendcr" and its associate commands are no longer required)
  36. ---------
  37. The "new method" would require an additional statement, though.  We
  38. would need to set the variable "ss_|" somewhere before the "SSLO ss_|"
  39. statement is processed.  We would set this variable by:
  40.  
  41.         {SETV ss_|,|}
  42.                ^   │
  43.                │   └──────────────────────> value (|=Carriage Return)
  44.                └───────────> variable name
  45.  
  46.  
  47. As long as I'm on the subject of "setting variables before xxxx is
  48. processed"..I prefer to dedicate the beginning sections of all my
  49. scripts as a "Variable Definition" area.  This is where I will set
  50. all the variables that will be used in the remainder of the script.
  51. To give you an example of what I'm talking about, here's how the
  52. MAILRUN.MAC might look with variables set at the beginning:
  53.  
  54. {:MAILRUN}
  55.    ------------------------- Variable Definitions  ---------------------
  56.    {SETV tries,100}
  57.    {SETV count,0}
  58.    {SETV ss_|,|}
  59.    ----------------------------------------------------------------------
  60.    {MARK example}
  61.  {:DIAL}
  62.    {DIAL-C,noconn}
  63.  {:LOGIN}
  64.    {CALO login,sendesc,Press <ESC> key}
  65.    {SSLO ss_|,More?}
  66.    {LOOK first name?}  {SEND Jim|}
  67. .
  68. .
  69.  {:NOCONN}
  70.    {INCR count}
  71.    {COMP count,%tries}
  72.    {IFCO done,dial}
  73.  {:SENDESC}
  74.    {SEND ^[} {RETU}
  75.  {:DONE}
  76.    {EXIT}
  77.  
  78.         I also recommend that when you're writing your scripts, add
  79. in any separators you like to make it easy to recognize areas (this
  80. will aid in the debugging process to be explored later).  The dashed
  81. lines and "Variable Definition" header above is an example of what I
  82. mean by "separators"..
  83.  
  84. END OF LESSON 6..NEXT LESSON: GOLOok
  85.  
  86. Jim
  87.