home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
jbtutor1.zip
/
LESSON10.TXT
< prev
next >
Wrap
Text File
|
1993-09-19
|
3KB
|
81 lines
IFEXist
=======
{COMMO} macro language contains commands for testing various
conditions. One purpose for testing a condition is to branch to
various segments of your script depending upon the result of the
test, i.e., if test result is "X", then branch to segment "A" in
script..if test result is "Y", then branch to segment "B" in script,
etc..
One "condition" that is applicable to any mailrun script is a test to
determine whether or not there are replies to send to the BBS during
any given session. Normally, a mailrun script would *always*
download new mail. But how do you handle those sessions where you
don't have a .REP file to send? What can we do to ensure .REPs are
uploaded if there is one, and the upload process is skipped if there
isn't a .REP?
Let's suppose our intended program flow for our mail send/rec portion
of the script is: Received mail door prompt?, upload replies if they
exist, otherwise download new mail. If replies exist, upload them
first, then continue on with mail download.
Here's how that process might look on your flowchart:
------------------------------------------------------------
┌───────────────────┐
│Receive Mail Prompt│
└─────────┬─────────┘
┌────────v─────────┐ Yes ┌──────────┐
│Do I Have Replies?├──────> Send "U" │
└────────┬─────────┘ └────┬─────┘
│ No ┌────v─────┐
│ │ Protocol │
│ │ Startup │
│ │ String │
│ └────┬─────┘
│ ┌────v──────┐
│ │ Exec Prot │
│ └────┬──────┘
│ ┌────v──────┐
│ │ Mail Prmpt│
│ └────┬──────┘
┌────v───┐ │
│Send "D"<─────────────────┘
└────────┘
------------------------------------------------------------
IFEXist will be the command that will answer the "Do I have replies"
question and will branch to the "Send U" or "Send D" segment
depending upon the answer. Here's how the coded segment might look:
.
.
{LOOK Mail Command?}
{IFEX %repdir%%bbsid.rep,send_u,send_d}
{:SEND_U}
{SEND u|}
{LOOK ^xB01} (assuming ZModem is the protocol we use on this BBS)
{EXEC %zprog port %_por rz %qwkdir}
{LOOK Mail Command?}
{:SEND_D}
{SEND d|}
.
.
End of Lesson 10. If you'd like something to ponder until next
lesson, the following alternative coding to the segment above
accomplishes the same thing, but contains a half-subtle method for
eliminating unnecessary labels in your script. Can you determine
how/why?
.
.
{LOOK Mail Command?}
{IFEX %repdir%%bbsid.rep,,send_d}
{SEND u|}
{LOOK ^xB01} (assuming ZModem is the protocol we use on this BBS)
{EXEC %zprog port %_por rz %qwkdir}
{LOOK Mail Command?}
{:SEND_D}
{SEND d|}
.
.
Jim