home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
jbtutor1.zip
/
LESSON6.TXT
< prev
next >
Wrap
Text File
|
1993-06-20
|
3KB
|
87 lines
SSLOok:
SSLOok is another conditional "look" command. It can be used
in lieu of CALOok. SSLOok is most useful for handling prompts that
will appear more than once on a BBS..for example "Press Any Key To
Continue" prompts. However, SSLOok may be used to handle *any*
prompt you'd like to apply it to.
If you've been reading the macro docs, you know that SSLOok
sends the value of a string variable that you've previously set.
Using the mailrun macro we've been working on as an example, SSLOok
could be used as a substitute for the CALOok statement in the
following way:
OLD METHOD USING CALOok:
{:LOGIN}
{CALO login,sendesc,Press <ESC> key}
{CALO login,send_cr,More?}
{LOOK first name?} {SEND Jim|}
.
.
{:SENDCR}
{SEND |}{RETURN}
----------
NEW METHOD USING SSLOok:
{:LOGIN}
{CALO login,sendesc,Press <ESC> key}
{SSLO ss_|,More?}
{LOOK first name?} {SEND Jim|}
.
.
(macro id "sendcr" and its associate commands are no longer required)
---------
The "new method" would require an additional statement, though. We
would need to set the variable "ss_|" somewhere before the "SSLO ss_|"
statement is processed. We would set this variable by:
{SETV ss_|,|}
^ │
│ └──────────────────────> value (|=Carriage Return)
└───────────> variable name
As long as I'm on the subject of "setting variables before xxxx is
processed"..I prefer to dedicate the beginning sections of all my
scripts as a "Variable Definition" area. This is where I will set
all the variables that will be used in the remainder of the script.
To give you an example of what I'm talking about, here's how the
MAILRUN.MAC might look with variables set at the beginning:
{:MAILRUN}
------------------------- Variable Definitions ---------------------
{SETV tries,100}
{SETV count,0}
{SETV ss_|,|}
----------------------------------------------------------------------
{MARK example}
{:DIAL}
{DIAL-C,noconn}
{:LOGIN}
{CALO login,sendesc,Press <ESC> key}
{SSLO ss_|,More?}
{LOOK first name?} {SEND Jim|}
.
.
{:NOCONN}
{INCR count}
{COMP count,%tries}
{IFCO done,dial}
{:SENDESC}
{SEND ^[} {RETU}
{:DONE}
{EXIT}
I also recommend that when you're writing your scripts, add
in any separators you like to make it easy to recognize areas (this
will aid in the debugging process to be explored later). The dashed
lines and "Variable Definition" header above is an example of what I
mean by "separators"..
END OF LESSON 6..NEXT LESSON: GOLOok
Jim