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

  1. (continued from Lesson 3a).
  2.  
  3. {:DIAL}{DIAL-C,noconn}
  4.  
  5. Let me expand on what this command does, since it's key to the test
  6. for dial attempts if no connect.  Each BBS in your phone directory
  7. can have a "linked macro".  In other words, the macro name that's
  8. specified in the linked macro field will be executed when a
  9. connection is made with the BBS.  The "noconn" is another macro name
  10. -- as with all other macro names, you have complete freedom of choice
  11. on it's value -- that will be executed if no connection is made
  12. during the dialing attempt.  This is where we'll compare # of
  13. attempts with # allowed.  I picked the name "noconn" only since it
  14. reminds me of "No Connect".
  15.  
  16. Let's look at the "noconn" macro:
  17.  
  18. {:NOCONN}
  19.     {INCR count}         <- adds "1" to our dialing counter
  20.     {COMP count,%tries}  <- compares counter to max # of attempts
  21.     {IFCO done,dial}     <- if values are equal, goes to macro named
  22.                             "done", if not equal, goes to macro named
  23.                             "dial"
  24.  
  25. The first time this is run, the "count" variable is "0" (remember, we
  26. initialized the value to "0" at the beginning?).  The first thing
  27. that happens is the counter gets incremented by one, and its value is
  28. now "1".  "1" will be compared to "100" (remember, we set the value
  29. of "tries" to "100" at the beginning?).  The compare will not match
  30. and the macro will go to "dial" to repeat the process.
  31.  
  32. OK, let's put all these together:
  33.  
  34. {:MAILRUN}
  35.    {SETV tries,100}{SETV count,0}
  36.    {MARK example}
  37. {:DIAL}
  38.    {DIAL-C,noconn}
  39. .
  40. . dots like these indicate the next piece does not have to follow
  41. . in sequence
  42. .
  43. {:NOCONN}
  44.     {INCR count}
  45.     {COMP count,%tries}
  46.     {IFCO done,dial}
  47. .
  48. .
  49. .
  50. {:DONE}
  51.     {EXIT}       <- exits back to DOS
  52.  
  53. This segment accomplishes what we set out to do in the first part of
  54. the flowchart.
  55.  
  56. Let me explain a little about my own script formatting techniques:
  57. You'll notice that I offset commands by a few spaces from the left
  58. margin.  This is not mandatory..I do it to improve readability.
  59. You'll also notice that I separate commands by one space from the
  60. macro ID that they relate to.  Again, this is not mandatory..I do it
  61. for readability.  {COMMO} macro IDs and commands can be chained
  62. together in the same line.  You are only limited by DOS' 255
  63. character line length.  The "noconn" macro, for example, would be
  64. just as correct, as far as {COMMO} were concerned, if it were
  65. written:
  66.  
  67. {:NOCONN}{INCR count}{COMP count,%tries}{IFCO done,dial}
  68.  
  69. The entire macro, so far, would be acceptable if written as:
  70.  
  71. {:MAILRUN}{SETV tries,100}{SETV count,0}{MARK example}{DIAL-C,noconn}
  72. {:NOCONN}{INCR count}{COMP count,%tries}{IFCO done,dial}{:DONE}{exit}
  73.  
  74. Use whatever format you feel is best for you..
  75.  
  76. END OF LESSON #3
  77.  
  78. Next Lesson:  Getting Logged On..
  79. Homework:     Study Lesson 3a/3b..ask any questions you may
  80.               have..study the following macro commands in the macro
  81.               docs:  LOOK, CALLook, GOLOok, SSLOok, SEND
  82.  
  83. Jim
  84.