home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
jbtutor1.zip
/
LESSON3B.TXT
< prev
next >
Wrap
Text File
|
1993-09-19
|
3KB
|
84 lines
(continued from Lesson 3a).
{:DIAL}{DIAL-C,noconn}
Let me expand on what this command does, since it's key to the test
for dial attempts if no connect. Each BBS in your phone directory
can have a "linked macro". In other words, the macro name that's
specified in the linked macro field will be executed when a
connection is made with the BBS. The "noconn" is another macro name
-- as with all other macro names, you have complete freedom of choice
on it's value -- that will be executed if no connection is made
during the dialing attempt. This is where we'll compare # of
attempts with # allowed. I picked the name "noconn" only since it
reminds me of "No Connect".
Let's look at the "noconn" macro:
{:NOCONN}
{INCR count} <- adds "1" to our dialing counter
{COMP count,%tries} <- compares counter to max # of attempts
{IFCO done,dial} <- if values are equal, goes to macro named
"done", if not equal, goes to macro named
"dial"
The first time this is run, the "count" variable is "0" (remember, we
initialized the value to "0" at the beginning?). The first thing
that happens is the counter gets incremented by one, and its value is
now "1". "1" will be compared to "100" (remember, we set the value
of "tries" to "100" at the beginning?). The compare will not match
and the macro will go to "dial" to repeat the process.
OK, let's put all these together:
{:MAILRUN}
{SETV tries,100}{SETV count,0}
{MARK example}
{:DIAL}
{DIAL-C,noconn}
.
. dots like these indicate the next piece does not have to follow
. in sequence
.
{:NOCONN}
{INCR count}
{COMP count,%tries}
{IFCO done,dial}
.
.
.
{:DONE}
{EXIT} <- exits back to DOS
This segment accomplishes what we set out to do in the first part of
the flowchart.
Let me explain a little about my own script formatting techniques:
You'll notice that I offset commands by a few spaces from the left
margin. This is not mandatory..I do it to improve readability.
You'll also notice that I separate commands by one space from the
macro ID that they relate to. Again, this is not mandatory..I do it
for readability. {COMMO} macro IDs and commands can be chained
together in the same line. You are only limited by DOS' 255
character line length. The "noconn" macro, for example, would be
just as correct, as far as {COMMO} were concerned, if it were
written:
{:NOCONN}{INCR count}{COMP count,%tries}{IFCO done,dial}
The entire macro, so far, would be acceptable if written as:
{:MAILRUN}{SETV tries,100}{SETV count,0}{MARK example}{DIAL-C,noconn}
{:NOCONN}{INCR count}{COMP count,%tries}{IFCO done,dial}{:DONE}{exit}
Use whatever format you feel is best for you..
END OF LESSON #3
Next Lesson: Getting Logged On..
Homework: Study Lesson 3a/3b..ask any questions you may
have..study the following macro commands in the macro
docs: LOOK, CALLook, GOLOok, SSLOok, SEND
Jim