home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
jbtutor1.zip
/
LESSON3A.TXT
< prev
next >
Wrap
Text File
|
1993-09-19
|
3KB
|
72 lines
If you've done your homework, your revised flowchart for the first
section should look something like:
┌──────────┐
│SELECT BBS│
│ TO CALL │
└─────┬────┘
┌──┴─┐
│DIAL│<──────────────────┐
└──┬─┘ No │
┌────┴───┐No ┌─────────┐ │
│CONNECT?├───>│MAX # OF ├──┘
└────┬───┘ │DIAL ATT?│
│ Yes └────┬────┘
|-─-└-─-| ┌─v──┐ Yes
| LOGON | │EXIT│
|-─-─-─-| └────┘
Let's take a stab at coding this puppy:
The first thing you need to do is give a name to the overall routine.
Come time to run the macro, you'll need to tell {COMMO} what it is
you want to run..the name will do the trick. Since you've been
reading the {COMMO} macro docs, you now know that the correct syntax
for a "name" (macro ID) is "{:"name"} -- the curly braces, enclosing
a colon and a "name". You can name things whatever you like..I'm
going to pick "{:MAILRUN}" as the name for the overall routine (NOTE:
{COMMO} isn't case sensitive..you can use upper/lower/mixed..I prefer
to use upper case for macro IDs since it helps me later on when I'm
editing/debugging the macros)
Step one, then is to open an ASCII text file with a .MAC extension
(to identify this file to commo as a "macro file")..again, let's call
the file "mailrun.mac".
Line 1 in MAILRUN.MAC would be:
{:MAILRUN}
The next step is to begin coding the macro itself. Looking at the
flowchart, we see that there's a parameter we're going to need to
check.."# of dial attempts". We need to set the value of this
parameter sometime before the check occurs..might as well be at the
beginning of the script. The macro command for setting parameters is
"SETVariable". Again, you have complete freedom on what you want to
name your variables, let's call the one for # of dial attempts
"tries"..and let's assume we want to try dialing a number 100 times.
{SETV tries,100}
We also need to initialize a counter for which dial attempt we're on
at the moment. This counter will be incremented for each dial
attempt, and then compared to the total number of attempts allowed if
connection isn't made. Let's call our counter "count":
{SETV count,0} (initializes the counter at "0")
Now we can continue with the marking/dialing/testing portion. The
command to select BBS(s) to dial is "{MARK}". Let's assume the board
we want to dial is named "Example BBS" in our phone directory. The
following command would select this board for dial:
{MARK example}
We now want to dial the BBS:
{:DIAL}{DIAL-C,noconn}
(continued in LESSON 3b)
Jim