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

  1. If you've done your homework, your revised flowchart for the first
  2. section should look something like:
  3.  
  4.                ┌──────────┐
  5.                │SELECT BBS│
  6.                │ TO CALL  │
  7.                └─────┬────┘
  8.                   ┌──┴─┐
  9.                   │DIAL│<──────────────────┐
  10.                   └──┬─┘                No │
  11.                 ┌────┴───┐No  ┌─────────┐  │
  12.                 │CONNECT?├───>│MAX # OF ├──┘
  13.                 └────┬───┘    │DIAL ATT?│
  14.                      │ Yes    └────┬────┘
  15.                  |-─-└-─-|       ┌─v──┐   Yes
  16.                  | LOGON |       │EXIT│
  17.                  |-─-─-─-|       └────┘
  18.  
  19. Let's take a stab at coding this puppy:
  20.  
  21. The first thing you need to do is give a name to the overall routine.
  22. Come time to run the macro, you'll need to tell {COMMO} what it is
  23. you want to run..the name will do the trick.  Since you've been
  24. reading the {COMMO} macro docs, you now know that the correct syntax
  25. for a "name" (macro ID) is "{:"name"} -- the curly braces, enclosing
  26. a colon and a "name".  You can name things whatever you like..I'm
  27. going to pick "{:MAILRUN}" as the name for the overall routine (NOTE:
  28. {COMMO} isn't case sensitive..you can use upper/lower/mixed..I prefer
  29. to use upper case for macro IDs since it helps me later on when I'm
  30. editing/debugging the macros)
  31.  
  32. Step one, then is to open an ASCII text file with a .MAC extension
  33. (to identify this file to commo as a "macro file")..again, let's call
  34. the file "mailrun.mac".
  35.  
  36. Line 1 in MAILRUN.MAC would be:
  37.  
  38. {:MAILRUN}
  39.  
  40. The next step is to begin coding the macro itself.  Looking at the
  41. flowchart, we see that there's a parameter we're going to need to
  42. check.."# of dial attempts".  We need to set the value of this
  43. parameter sometime before the check occurs..might as well be at the
  44. beginning of the script.  The macro command for setting parameters is
  45. "SETVariable".  Again, you have complete freedom on what you want to
  46. name your variables, let's call the one for # of dial attempts
  47. "tries"..and let's assume we want to try dialing a number 100 times.
  48.  
  49. {SETV tries,100}
  50.  
  51. We also need to initialize a counter for which dial attempt we're on
  52. at the moment.  This counter will be incremented for each dial
  53. attempt, and then compared to the total number of attempts allowed if
  54. connection isn't made.  Let's call our counter "count":
  55.  
  56. {SETV count,0}  (initializes the counter at "0")
  57.  
  58. Now we can continue with the marking/dialing/testing portion.  The
  59. command to select BBS(s) to dial is "{MARK}".  Let's assume the board
  60. we want to dial is named "Example BBS" in our phone directory.  The
  61. following command would select this board for dial:
  62.  
  63. {MARK example}
  64.  
  65. We now want to dial the BBS:
  66.  
  67. {:DIAL}{DIAL-C,noconn}
  68.  
  69. (continued in LESSON 3b)
  70.  
  71. Jim
  72.