home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
BOYDOC50.ZIP
/
BOYFILES.ZIP
/
BD5
< prev
next >
Wrap
Text File
|
1991-07-01
|
105KB
|
1,973 lines
Chapter 5
BOYAN Power--Macros and Script Files
5.1 Overview
A macro is a sequence of commands which instructs BOYAN to perform some
action. Beneath the "surface" of BOYAN which you normally see, macros
are responsible for a variety of tasks--for instance, dialing the modem,
handling your keyboard commands, and maintaining the activity log.
Because all these macros are user-programmable, you have a great deal of
power in determining what BOYAN does, and when and how it does it.
BOYAN's Macro Programming Language is described in section 5.2. Many
useful sample macros are presented in section 5.3.
To automate even the most complex communication tasks, BOYAN allows you
to link many macros together into text files called "scripts." Although
BOYAN can create simple scripts automatically with the Script Learn
facility (section 4.7.3), you can write much more powerful scripts. A
script file could take control of your computer at a pre-assigned time,
dial into a database, perform a search, and print the results--all with
nobody at the keyboard. BOYAN's Host Mode is written completely as a
script file. Still another application for script files might be to
create a customized front-end menu interface for all of BOYAN's
commands. BOYAN scripts are explained in section 5.5.
5.2 The Macro Programming Language
Most macro/script commands consist of a backslash plus two characters;
for example, \zs is the command to "zap" (clear) the screen. Many
commands also require further information enclosed in square brackets;
for example, \di[730-2917] is the command to dial the specified phone
number. A macro is a sequence of one or more commands, all strung
together on a line of text. Thus the macro \zs \di[730-2917] would
instruct BOYAN to first clear the screen, and then dial the modem.
Spaces may be placed between commands to make the macro easier to read.
5.2: BOYAN Power--Macros and Script Files 81
________________________________________________________________________
The Macro Programming Language also provides approximately 100 variables
which can be included in any command. Variables are specified by a
percent sign plus two characters; for example, %XP represents the
current X-position of the cursor. Wherever a BOYAN variable is found in
a macro, it is replaced by its current value. (A variable may also be
specified with an @-sign, e.g., @XP instead of %XP. The technical
difference between % and @ is explained in section 5.5.6.2.)
The next several sections explain the many variables and commands you
can use to automate BOYAN. The commands and variables have been divided
into categories such as String Output, Dialing, File Transfers, User
Variables, and Script-specific commands. Note that there is also an
alphabetical summary of all macro commands and variables at the end of
this chapter.
5.2.1 String Output
Any macro can include a string of text like "password". Such a string
is sent directly over the modem. Eight characters--the caret, quotation
mark, backquote, tilde, left curly brace, percent sign, at-sign, and
backslash--have special meanings and are not sent directly over the
modem unless they are preceded by a quotation mark. The special
meanings of these characters are described in section 3.9.1. The
following example demonstrates some basic commands:
ATZ{~```\$```WELCOME CLASS OF "`99{
The example sends ATZ <Enter> to the modem, and then pauses for one-half
second (~). The backquotes are for spacing and the macro processor
ignores them. The \$ command causes Shortcut macro #114 to be
processed. Finally, the phrase WELCOME CLASS OF `99 is sent to the
modem, where the quotation mark signifies that the character that
follows, the backquote, should be sent over the modem, not ignored like
the other backquotes.
5.2.2 How to Read the Macro Definitions
In the command format descriptions, the following conventions are used:
c represents a single character, like Y
x, y, or z represents an integer number, like 12. Numbers may be
specified in hexadecimal if they are preceded by a $
sign, like $1B.
filename represents a full filename specifier, such as FOO.ZIP
or C:\MODEM\FILES\BOYAN.DOC.
5.2.2: BOYAN Power--Macros and Script Files 82
________________________________________________________________________
string represents a string of characters not to be processed
as a macro, like WELCOME!
macro represents an executable macro, like \DI[730-2917]
5.2.2.1 Conditional Macro Syntax
Conditional macro commands allow your macros to make decisions. With
each conditional command, you enclose a macro in brackets which is to be
executed only if the condition is met. For example, the \CA+[..]
conditional macro tests whether there is a carrier signal. The macro:
\CA+[\ST[You are online.]]
displays the Status message "You are online" only if there is a carrier.
If there is no carrier, then the macro has no effect.
If-then-else decisions may be programmed by placing the special string
|ELSE inside the enclosed macro. You may abbreviate the |ELSE by a
single vertical bar |. The part of the macro beyond the |ELSE string is
executed only if the condition was NOT met. For example, the macro:
\CA+[\ST[You are online.] |ELSE \ST[You are offline.]]
displays "You are online" if the carrier signal is detected, or "You are
offline" if no carrier is present. The identical effect can be achieved
using the complementary \CA-[..] macro:
\CA-[\ST[You are offline.] |ELSE \ST[You are online.]]
* * * *
Each macro command and variable below is presented with its format on
the left, an example on the right, and a mnemonic and description
following.
5.2.3 Modem Commands
^c ^[
Sends the specified control character; e.g., ^X sends a control-X; ^[
sends the <Escape> character. Note that ^M, which sends a <Return>, can
also be represented as { in a BOYAN macro.
\CA+[macro] \CA+[\DM[You have connected!]|\DM[No connection.]]
\CA-[macro] \CA-[ATS0=0{]
CArrier? The \CA+ command processes the enclosed macro only if BOYAN
detects carrier, that is, if the modem is currently connected. The \CA-
command processes its macro only if BOYAN does not detect carrier.
5.2.3: BOYAN Power--Macros and Script Files 83
________________________________________________________________________
\CH[x] \CH[127]
CHaracter. Sends the ASCII character with code x (0..255) over the
modem. For example, ASCII 127 represents the "Del" key on many
terminals, so \CH[127] would simulate pressing "Del." ASCII character
27 is "Escape", so \CH[27] has the same effect as ^[.
\CM
Change Modem parameters. This macro calls up a menu, from which the
user can change the modem device, speed, or parity.
\CD[x] \CD[2]
%MD %MA %MN 2 3E8 4
Change Device (serial port). The \CD macro changes the current modem
device to port 1, 2, 3, or 4, and resets that port. The %MD variable
holds the number of the current Modem Device (1..4). Variable %MA holds
the memory address of the port in hexadecimal (without the $ sign), and
%MN holds the IRQ Interrupt line used by the port (2, 3, 4, or 5).
\CS[x] \CS[1]
%MS %MM 1200
Change Speed. This changes the current modem speed setting to 300,
1200, 2400, 4800, 9600, 19200, or 38400 baud depending on whether x is
3, 1, 2, 4, 9, 0, or 8. You may also use the full number if you wish,
like \CS[19200]. %MS holds the current baud rate, and %MM holds the
Maximum Modem speed as configured in Config Area <S>.
\CP[c] \CP[E]
%MP E
Change Parity. This changes the current modem parity setting to None,
Even, or Odd depending on whether c is N, E, or O. You may use the
full word if you wish, like \CP[Even]. %MP stores the current Modem
Parity--N, E, or O (not the full word).
\DD+ \DD- \DD*
Drop DTR. \DD+ causes the DTR signal to be Dropped upon changing ports
or exiting BOYAN, in effect hanging up the modem. \DD- makes BOYAN
maintain the DTR signal when exiting. \DD* toggles between the two.
\DT+ \DT- \DT* \DT-~~\DT+
DTR. Use \DT+ to turn the Data Terminal Ready signal ON, \DT- to turn
DTR OFF, or \DT* to toggle its state. Turning DTR off for one second
usually makes the modem hang up.
\HU
Hang Up. This hangs up the modem by running BOYAN macro #4.
\PL
Purge Line. This purges the data line of all incoming characters; i.e.,
ignore all incoming characters until the receive buffer is empty.
5.2.4: BOYAN Power--Macros and Script Files 84
________________________________________________________________________
\SB
Send Break. This sends a modem break signal.
5.2.4 Terminal Characteristics
\AM[]
\AM[c] \AM[G]
Action Module. If the space between the brackets is empty, BOYAN
provides a menu from which you can select a new Action Module. If you
include a character between the brackets, BOYAN attempts to load the
Action Module corresponding to that character: [1]=VT-100, [G]=GOSSIP,
etc.
%AM G
Action Module. The letter or digit corresponding to the current BOYAN
Action Module in use.
%AN GOSSIP
Action module Name. The full name of the current BOYAN Action Module.
%AP 1
Action module (Previous). The letter or digit corresponding to the
previous BOYAN Action Module in use; that is, the module which was in
use before the current one was selected. For example, the macro
\AM[%AP] would instruct BOYAN to switch back to the previous action
module.
\B8+ \B8- \B8* %B8
Bit 8. The \B8 command controls whether or not BOYAN recognizes the
eighth (high) bit of incoming characters. \B8+ makes BOYAN recognize
the eighth bit, allowing IBM graphics characters to be seen. \B8-
causes BOYAN to strip the eighth bit, converting IBM graphics characters
to their regular 7-bit ASCII equivalents. \B8* toggles back and forth
between the two states. The %B8 variable equals "ON" when the eighth
bit is allowed, or "OFF" when the eighth bit is stripped.
\BD+ \BD- \BD* %BD
Backspace/Del swap. Certain terminal emulation BAMs such as VT-100 and
IBM-3101 offer an option to swap the Backspace and Del keys. When in
such a BAM, you may use the \BD+ macro to swap the keys, \BD- to
"unswap" the keys, \BD* to toggle between \BD+ and \BD-, and the %BD
variable to reflect whether BS and Del are currently swapped ("ON") or
normal ("OFF").
\BU+ \BU- \BU* %BU
BUffering. You must have the National Semiconductor 16550AN UART chip
to use this command. The 16550AN provides FIFO buffering of received
modem text, which makes high-speed downloads reliable even under a
multitasking or network environment. The \BU+ command initializes the
5.2.4: BOYAN Power--Macros and Script Files 85
________________________________________________________________________
FIFO buffer to its maximum size of 14 bytes, and modifies BOYAN's
interrupt processing routine appropriately. \BU- disables the buffer,
and \BU* toggles. Technical note: when you shell to DOS or exit BOYAN,
FIFO buffering is restored to the state it was in upon entering BOYAN.
\CT+ \CT- \CT*
CTS/RTS. Use \CT+ to turn CTS/RTS hardware flow control ON, \CT- to
turn CTS/RTS flow control OFF, and \CT* to toggle between the two
settings.
\EC+ \EC- \EC* %EC
ECho. \EC+ turns local echo ON, \EC- turns local echo OFF, and \EC*
toggles back and forth between the two. The %EC variable can always be
used to determine the current state of echo mode: %EC equals "ON" or
"OFF".
\LF+ \LF- \LF* %LF
Line Feeds. \LF+ turns add line feeds mode ON, \LF- turns line feeds
OFF, and \LF* toggles between the two. %LF maintains the current state
of the toggle, "ON" or "OFF".
\TT+ \TT- \TT* %TT
Translation Table. \TT+ turns the table ON; \TT- turns it OFF; \TT*
toggles it. The %TT variable reflects whether the table is "ON" or
"OFF".
\XX+ \XX- \XX*
Xon/Xoff. Use \XX+ to turn Xon/Xoff software flow control ON, \XX- to
turn Xon/Xoff control OFF, and \XX* to toggle between the two settings.
5.2.5 Backspace Buffer
\BC
Back destructively over Character. This command is identical to sending
a backspace (^H), except the deleted character is not added to BOYAN's
backspace buffer.
\BW+ \BW-
Back over Word. This sends backspaces until a space is reached. \BW+
saves the erased word in the backspace buffer; \BW- does not.
\FC
Forward Character. This sends the most recent character stored in the
backspace buffer.
\FW
Forward Word. This sends characters from the backspace buffer until a
space is reached.
5.2.6: BOYAN Power--Macros and Script Files 86
________________________________________________________________________
5.2.6 Timing
~ (tilde)
BOYAN pauses for approximately 0.5 seconds whenever the tilde character
is found in a macro. For long pauses, \PA[x] is a better alternative.
%HR %MI %SE 18 09 59
HouR, MInute, SEcond. These variables hold the current hour, minute,
and second, respectively. Each is exactly two digits long. The hour is
given in 24-hour notation: i.e., at six o'clock PM, %HR equals 18; at
midnight, %HR equals 00.
%MO %DA %YR 09 03 92
MOnth, DAy, YeaR. Each of these variables is exactly two digits long.
\PA[x] \PA[20]
PAuse. This makes BOYAN pause for x (1..32767) seconds. See also the
\AL macro command, which sounds an alarm for a specified number of
seconds (section 5.2.10).
\PU[##:##] \PU[2:30]
Pause Until. Make BOYAN pause until the specified time. The above
example would make BOYAN wait until 2:30 AM before continuing. Use 24-
hour notation to specify times after noon; e.g., \PU[14:30] to pause
until 2:30 PM. Note that midnight = 0:00.
\SL[x] \SL[0]
Set Line pacing to x (0..255) milliseconds. This is the amount of time
BOYAN will pause after sending a Carriage Return in a macro or ASCII
upload, in addition to the character pacing time.
\SP[x] \SP[10]
Set Pacing. This sets character pacing to x (0..255) milliseconds, the
amount of time BOYAN will pause between sending each character in a
macro or ASCII upload.
\UT##:##[macro] \UT`20:00[\DM[%HR:%MI:%SE]]
Until Time. Until the specified time (24-hour format), this repeatedly
executes the enclosed macro. The above example would display a running
clock on the screen until 20:00 (8:00 PM).
5.2.7 Handshaking
\IF+string[macro] \IF+End of messages[\GB[LogOff]]
\IF-string[macro] \IF-File not found[\DLk[twiddle.arc]]
If Found? The \IF+ command processes the enclosed macro only if the
specified string is found on the current screen line or the line
immediately above the cursor. The \IF- command processes its macro only
if the string is not on the current line or line above. The matching is
5.2.7: BOYAN Power--Macros and Script Files 87
________________________________________________________________________
not case-sensitive. Once a given string on the screen is matched, it is
highlighted and will not be matched again. See the related \WF and \UN
commands.
\IW+[macro] \IW+[\DM[Log-on successful!]]
\IW-[macro] \IW-[\DM[Log-on interrupted.]\GB[quit]]
If Waitfor successful? The \IW+ command processes the enclosed macro
only If the last WaitFor, UNtil, or IF command was successful. The \IW-
command processes the enclosed macro only if the last such command timed
out before successfully making a match.
\TO[x] \TO[40]
TimeOut. Set the handshake timeout to x (0..255) seconds. This is the
amount of time BOYAN waits before "giving up" trying to match a \WF or
\WL command. If x is 255, then it means "indefinitely": \TO[255] sets
an indefinite timeout, and BOYAN will never give up waiting for a match!
\UNstring[macro] \UN`End of file[^K]
UNtil. This repeatedly executes the macro enclosed in the brackets
until the specified string arrives from the modem. The above example
sends a continuous stream of control-K characters until BOYAN sees the
"End of file" message.
\WF[] \WF[]
\WF[string] \WF[Enter your name:]John Johnson{
Wait For the specified string to arrive from the modem. If 30 seconds
(or whatever value you configure or set with the \TO command) elapses
before the string appears, the macro times out and will continue to the
next command. The string is not case-sensitive, so NAME will match
NaMe . If the brackets are empty, BOYAN will simply wait for any
character. While BOYAN is waiting, if you press <space>, BOYAN will
assume the matching was unsuccessful and continue to the next command.
(Pressing <Esc> always aborts the entire macro/script.) You can use the
\IW command to test for the success of the waitfor (section 5.2.7).
See also the \UN (until) and \IF (if found) commands.
\WL \WL
Wait for a new Line (carriage return) from the modem.
\WP[x] \WP[2]{
Wait for Pause. This command instructs BOYAN to Wait for a Pause of x
seconds in the remote system's input. Suppose you execute the command
\WP[2]. As long as input continues to flow in from the modem, the macro
will simply wait. However, when there is a pause in the flow of
input--in this case, two seconds during which nothing new arrives from
the modem--the \WP[2] command will finish, and the macro processor will
continue on to the next command. In effect, \WP[2] makes BOYAN wait for
the next prompt for input! See the TCOMM.BSC script for details.
5.2.8: BOYAN Power--Macros and Script Files 88
________________________________________________________________________
5.2.8 Dialing
\AD+ \AD- \AD*
Auto-Detect. Use \AD+ to turn auto-detection of the modem connect speed
ON, \AD- to turn Auto-Detection OFF, and \AD* to toggle between the
two. This feature is explained in section 3.8.
\CC+ \CC- \CC*
Carrier Checking. \CC+ enables BOYAN's carrier checking before dialing.
With carrier checking enabled, BOYAN will prompt you to verify that it
is "OK to dial despite carrier" if you try to dial while already on-
line. \CC- disables carrier checking; \CC* toggles.
\CO[x] \CO[60]
COnnect timeout. Set the COnnect wait time to x seconds (0..99). After
dialing with <Alt-D>, BOYAN will assume that no connection has been made
if the modem fails to respond within this amount of time.
\DI[] \DI[]
\DI[x] \DI[12]
\DI[string] \DI[Compuserve]
\DI[###-####] \DI[381-6441]
DIal. If the brackets are empty, \DI[] simply enters the dialing
directory. If a number from 1-200 is enclosed, this command dials the
system with the specified dialing directory code; if you make a
connection, the appropriate automatic logon script will also be run (see
section 5.5.2). If a string is enclosed, BOYAN will search your dialing
directory for an entry whose name contains that string, and dial the
first such entry it finds. (This may be preferable to giving the
precise code number, since the code may change if you sort the
directory.) Finally, if the string does not match any directory entry
name, BOYAN attempts to manually dial the enclosed string.
%F: C:\BOYAN\FON\
Fon path. This variable stores the name of the path in which BOYAN
expects to find all its FON directories. To reconfigure this path, see
section 3.6.
\FD[filename] \FD[CHICAGO.FON]
%FD CHICAGO.FON
Fon Directory. The \FD macro command loads the specified new Fon
Directory. The filename suffix of .FON is optional. If the file you
specify is not a valid BOYAN directory, the previous .FON directory will
be reloaded. The name of the current FON directory is always stored in
the %FD variable.
5.2.8: BOYAN Power--Macros and Script Files 89
________________________________________________________________________
\IS+x,y,..,z[macro] \IS+1,6,114,0,3,30[password1|password2]
\IS-x,y,..,z[macro] \IS-0[\DM[Phone number = %SF.]]
Is System? The \IS+ command processes the enclosed macro only If the
directory code of the System you last dialed is on the list of numbers.
The \IS- command processes its macro when the last-dialed system is not
on the code list. The codes run from 1-200 for dialing directory
entries, and 0 for manual dialing. This command is convenient when, for
example, you use different passwords on otherwise-identical systems, and
need to select a password based on which system you connected to.
%PW ibm-pc
%S# 12
%SF 1-301-854-3076
%SN BOYAN Support BBS
%SS PCBOARD
%SL 0:15:30
System information. These six variables contain information about the
system which is currently online. If you are online with a system
dialed from the dialing directory: %PW equals its password; %S# equals
its code number (1-200); %SF equals its phone number; %SN equals its
Name; %SS equals the name of its logon script file (without the .BSC
suffix); and %SL is the total elapsed time since the connection was
made. These values can be used in Auto-macros #6 and #7, for example,
to update the BOYAN.USE activity log. When you are offline, %PW equals
the default value set in Config Area <S>; %S# equals 0, the %SL clock
keeps running, and the other variables are blank.
5.2.9 Queue Redialing
\QA[x] \QA[12]
\QA[###-####] \QA[381-6441]
\QA[string] \QA[Boyan Support]
\QA+[string] \QA+[Boyan Support]
Queue Add. If a number from 1-200 is enclosed, this command adds the
system with the specified dialing directory code to the redialing queue.
Otherwise, BOYAN searches the dialing directory for an entry whose name
contains string, and adds that entry to the Queue. If a + is placed
before the left bracket, then all matching entries will be added to the
queue; with no +, only the first matching entry is added. If the string
in brackets is not an entry name but a phone number, then BOYAN will
simply add that number to the queue.
\QA-[x] \QA-[12]
\QA-[string] \QA-[%SN]
Queue Subtract. If a number from 1-200 is enclosed, this command
deletes the entry with that code number from the redialing queue. If a
string is enclosed, then all queue entries whose names are "close
enough" to that string are removed from the queue. To BOYAN, a queue
name is "close enough" to the specified string if that string, not
5.2.9: BOYAN Power--Macros and Script Files 90
________________________________________________________________________
including its last character, is contained as a substring of the queue
name. For example, the command \QA-[BOYAN Support Line 2] will delete
queue entries named BOYAN Support Line 1 and BOYAN Support Line 3 as
well as BOYAN Support Line 2. If you insert the command \QA-[%SN] into
Auto-macro #6, then after connecting to a system, all other systems
whose names are "close enough" will automatically be deleted from the
queue.
\QC
Queue Clear. Clear the queue of all entries.
\QD
Queue Dial. This makes BOYAN repeatedly dial the numbers in the queue
until a connection is made. When BOYAN connects, it removes that number
from the queue and rings the connect alarm. If the connected system has
a logon script specified in its Dialing Directory entry, BOYAN stops
ringing the alarm after the "Script Keyboard Timeout" has expired, and
runs the script's LOGON block as described in section 5.5.2. If the
queue is empty, this command does nothing.
\QE
Queue Enter. The \QE command causes BOYAN to enter the redialing queue
and wait for user key commands.
%QS \IE+%QS,0[\EX | \QD]
Queue Size. The number of entries in the Queue (0..20). The example
macro will exit BOYAN if the queue is empty, or begin queue redialing
otherwise.
\QU[##:##] \QU[6:15]
Queue Until. This command is identical to the \QD command, except that
redialing will stop at the specified time if no connection has been made
yet. Use 24-hour notation, e.g., \QU[23] to redial until 11:00 pm. See
section 5.3.2 for an example of how to use this command in an Auto-
macro.
5.2.10 Screen & Sound
\ALx[y] \AL1[5]
\ALx[0] \AL3[0]
\ALx[] \AL2[]
ALarm. BOYAN provides three alarms: alarm #1 is a constant tone; alarm
#2 is a two-tone "ringing"; and alarm #3 is a descending squawk. The
pitch of the alarm is controlled by the alarm volume setting (below).
The \ALx command rings alarm # x (1, 2, or 3). The number y (0..255) in
brackets determines the length of the alarm in seconds. If y is 0, the
alarm tone sounds just once, and stops. If the brackets are left empty,
then the alarm will ring continuously until the user presses a key.
5.2.10: BOYAN Power--Macros and Script Files 91
________________________________________________________________________
\AV[x] \AV[4]
Alarm Volume. Change the alarm volume from 1 to 10, or silence all
alarms with 0.
\BB+ \BB- \BB* %BB \AV[0]\BB-
Beeps & Bells. \BB+ turns Beeps & Bells mode ON; \BB- turns it OFF;
and \BB* toggles between the two states. The %BB variable equals "ON"
or "OFF" as appropriate. The example macro above can be used to
completely silence all BOYAN sound effects.
\DMC[x] \DMC[240]
%DM 240
Display Message Color. Set the Display Message Color to x (1..255).
This color will be used for messages displayed with subsequent \DM
commands. Note that numbers greater than 128 are flashing; for example,
select color 240 for flashing black on white. The %DM variable holds
the Display Message color.
\DM[string] \DM[You have connected!]
\DMx,y[string] \DM40,10[Menu of Options]
\DMy[string] \DM1[This message is in color %DM.]
\DMx,[string] \DM30,[The time is now %HR:%MI.]
Display Message. The \DM command is used to display a message on the
screen. The string will be displayed at column x (1..80), line y
(1..24). If either x or y is omitted before the string in brackets,
then BOYAN substitutes default values. If x is omitted, BOYAN flushes
the string to the right of the screen. If y is omitted, BOYAN uses the
line above the current cursor position. In the examples above, "You
have connected" is flushed right on the line above the cursor; "Menu of
Options" is at column 40, row 10; "This message is in color ###" is
flushed right on line 1; and "The time is now ##:##" is at column 30 on
the line above the cursor. \DM can be used in conjunction with the \KV
command to make user menus, for example (see section 5.2.14).
\GL+ \GL- \GL* %GL
Grab screen Lines (EGA/VGA monitors only). \GL+ loads the 8x8 ROM
screen font, causing an EGA adapter to display 43 lines of text or a VGA
adapter to display 50 lines of text. \GL- restores a 25-line screen.
\GL* toggles between \GL+ and \GL-. The variable %GL always holds the
current number of lines displayed (25, 43, or 50).
\GX[x] \GX[40]
Goto X-position. This moves the cursor horizontally to the specified
column (1..80).
\GY[y] \GY[20]
Goto Y-position. This moves the cursor vertically to the specified row
(1..24).
5.2.10: BOYAN Power--Macros and Script Files 92
________________________________________________________________________
\KS \RS
Keep Screen, Restore Screen. These commands are useful for making
user-defined "pop-up" menus. \KS does several things: it saves a copy
of the top 24 lines of the screen into memory; it saves the current
cursor position; and it temporarily inhibits all I/O from the modem.
After \KS, you could clear the screen (with \ZS) or display menu
messages (with \DM). When you want to Restore the Screen contents and
cursor position, use the \RS macro. Note: BOYAN restores the screen
automatically, even without \RS, if either 1) you invoke a command which
needs to save the screen (e.g., Dialing Directory or a file transfer),
or 2) you abort the macro/script by pressing <Esc>.
\MC[x] \MC[112]
%MC 112
Menu Color. \MC[x] sets the Menu and help screen Color to x (1..127).
The %MC variable holds the current Menu Color in use.
\NC[x] \NC[7]
%NC 7
Normal Color. \NC[x] sets the Normal text Color to x (1..127). The %NC
variable holds the current Normal text Color in use.
\RC
Restore Color. This command Restores the default normal text Color.
\RX[x] \RX[-10]
Relative X-position. This moves the cursor horizontally by the
specified number of spaces, backward (negative numbers) or forward
(positive numbers). The cursor will not go beyond either end of the
line.
\RY[y] \RY[5]
Relative Y-position. This moves the cursor vertically by the specified
number of lines, up (negative numbers) or down (positive numbers). The
cursor will not go beyond either end of the screen.
\SN[string] \SN[%SN]
System Name status. This displays the string on the right side of the
status line, where the current System Name is normally displayed.
\ST[string] \ST[Beeps & Bells are now %BB.]
STatus. This displays the string on the left side of the status line.
This sample macro displays the current status of the Beeps & Bells
toggle.
%XP %YP
X-Position, Y-Position. These variables equal the current column
(1..80) and row (1..24) of the cursor, respectively.
5.2.11: BOYAN Power--Macros and Script Files 93
________________________________________________________________________
\ZS
"Zaps" (clears) the Screen.
5.2.11 Session Logging & Printing
\LD+ \LD- \LD* %LD %LN \LD*\ST[Logging to %LN is now %LD.]
\LD+[filename] \LD+[C:\%MO-%DA-%YR.LOG]
Log to Disk. \LD+ opens a log file. If no filename is specified, the
default (or most recently-used log file) is used. Opening the log file
runs Auto-macro #14, which inserts a header with the date and time in
the file. While the log file is open, all text appearing on the
communication screen is saved to the file. \LD- closes the open log
file; \LD* toggles logging ON and OFF. The %LD variable maintains the
status of the log file as "ON" or "OFF". %LN holds the full name of the
last log file opened, or the default BOYAN.LOG if none has been opened
yet. In the second example above, the date variables are used to open a
log file with the date in the filename; for example, on November fourth,
the filename used would be C:\11-04-91.LOG.
\LM[string] \LM[== Connected to %SN ==]
Log Message. This inserts a message in the log file if the file is
open. If you include the example macro above in your Connect Auto-macro
#6, then whenever you connect to a system while the log file is on, a
line with that system's name will be added to the log.
\PM[string] \PM[== Connected to system number %S# ==]
Print Message. This command prints the specified string on your
printer. You can use this command to set up printer initialization
codes; for example, \PM[^X^[g] sends <Ctrl-X>,<Escape>,<g>.
\PP[x] \PP[2]
Printer Port. Select a new device (1, 2, 3, or 4) for all subsequent
printing.
\PR+ \PR- \PR* %PR
PRinter. \PR+ turns printer log mode on. If used in a script file,
printer logging starts immediately; otherwise, BOYAN's printer setup
menu is displayed. All text appearing on the communication screen is
printed until printer logging is turned off by \PR-. \PR* toggles
printer logging; %PR equals "ON" or "OFF" as appropriate.
\PS
Print Screen. This is identical to keying <Shift-PrtSc> by hand.
\SS %DN
Save Screen to disk. This command saves the current screen to the BOYAN
screen dump file (see section 3.6). The Dump file Name is stored in
variable %DN.
5.2.11: BOYAN Power--Macros and Script Files 94
________________________________________________________________________
\UF+ \UF- \UF* %UF \UF*\ST[Usage file now %UF.]
\UF+[filename] %UN \UF+[LONGDIST.USE]
Usage File. \UF+ and \UF- turn the BOYAN.USE usage file on and off,
respectively. If a filename is specified after the \UF+ command, BOYAN
will use that filename for the usage file. \UF* toggles the usage file,
and the %UF variable holds its current status, "ON" or "OFF". %UN holds
the full Name of the current Usage file.
\UM[string] \UM[Current DOS directory = %C:]
Usage Message. This command enters a line into the usage file. The
date and time are automatically appended to the beginning of the line,
in whatever format you specify (see section 3.6). To add a line to the
usage file without the date/time prefix, use the command \AF%UN[..your
msg here..] instead. If the Usage File is OFF, the \UM command has no
effect. The example above would add a line to the end of the usage file
showing the current DOS path.
5.2.12 DOS
\AFfilename[string] \AF`LETTER.TXT[This file is dated %MO/%DA/%YR.]
Append to text File. This very powerful command allows scripts to build
custom text files. The string is appended to the end of the text file
specified by filename. If that file does not exist, BOYAN creates it.
The Host Mode script uses this command to create a message file as the
message is being typed. See also the \GV command (for reading from a
text file).
%B: D:\BOYAN\
BOYAN path. This variable holds the BOYAN home directory's drive+path.
%C: A:\
Current path. This variable holds the current disk directory's
drive+path.
\CF+ \CF- \CF*
Check Free. \CF+ tells BOYAN to automatically check free disk space
before each download and within the directory file manager. \CF- means
you must manually press <Alt-F> in the download menu or F in the file
manager to see remaining disk space. \CF* toggles.
\DC[string] \DC[pkunzip -v boyan5a]
\DC-[string] \DC-[dir >prn:]
\DC+[string] \DC+[type %DN]
DOS Command. BOYAN invokes the COMMAND.COM processor to execute
[string] as a DOS command. If you use the \DC- command, BOYAN will
continue immediately after the DOS command finishes. With \DC+, you
will be prompted for a keypress before returning to BOYAN. The plain
\DC command (with no minus) usually prompts for a keypress, but does not
if there is a script file running.
5.2.12: BOYAN Power--Macros and Script Files 95
________________________________________________________________________
%DR A
DRive. This variable holds the currently-logged disk drive letter.
%DS 125
DOS Shell space. This variable equals the amount of memory (in K)
available for DOS Shells. If %DS equals 0, then the \JD and \DC
commands cannot function.
\FE+filename[macro] \FE+c:\files\twiddle.arc[\UL[twiddle.arc]]
\FE-filename[macro] \FE-boyan5a.zip[\DC[pkzip boyan5a *.*]]
File Exists? With the \FE+ command, the enclosed macro is processed
only if the specified file exists on your disk. The \FE- command
processes the enclosed macro only if the specified file does not already
exist.
\FM[filespec] \FM[c:\util\]
\FMc[filespec] \FMU[]
\FMstring[filespec] \FM`pkunzip -v[%D:*.ZIP]
The File Manager. Within the brackets, specify the path and/or wildcard
pattern of files to display, or leave the brackets empty to display all
files in the current directory. There are also two ways to specify the
File Manager "default command", which is the the command selected when
you press <Enter> or double-click the mouse on a filename:
1. Between \FM and [filespec], include a single letter (any of C D E
F I L M R S U V W). The File Manager command corresponding to
that letter will become the default command. For example, \FMU[]
invokes the File Manager in the current directory with Upload as
the default command.
2. Between \FM and [filespec], include a DOS command two or more
characters long. The File Manager default will then invoke that
DOS command, giving it the name(s) of the selected file(s) as its
argument. The "pkunzip -v" example above invokes the File
Manager on all *.ZIP files in your Download directory; to view
the contents of a .ZIP file, you would simply highlight that file
and press <Enter>.
\FS[c] \FS[%DR]
Free Space. This displays a status message showing the number of bytes
of free space on the specified disk drive.
\JD \AT+[\JD]
Jump to DOS. You must type EXIT <Enter> to return to BOYAN from DOS,
so be sure this command is not processed when BOYAN is unattended.
5.2.12: BOYAN Power--Macros and Script Files 96
________________________________________________________________________
%LC TYPE
List Command. This variable holds the DOS command you have configured
for viewing a file. For example, to view the BOYAN.USE file, you would
run the \DC[%LC boyan.use] macro.
\ND[string] \ND[b:\download]
New Directory. This command selects a new default disk drive or path.
%S: D:\BOYAN\SCRIPT\
Script path. This variable holds BOYAN's script file disk drive+path.
%SC HOST.BSC
SCript. This variable holds the name of the current script file running
(or the last script file run, if none is active).
%WC EDLIN
Word processor Command. This variable holds the DOS command you have
configured for editing a file.
5.2.13 File Transfers
\AU+ \AU- \AU* %AU \AU* \ST[Auto-downloading is now %AU]
AUto-downloading. \AU+ enables auto-downloading, \AU- disables, \AU*
toggles between the two. %AU maintains the current state of the toggle,
"ON" or "OFF".
%D: C:\MODEM\DL\
%U: B:\
Download path, Upload path. These variables hold the name of the
default download and upload directories, respectively.
\DLc-[filename] \DLY-[c:\twiddle.zip]
DownLoad. The \DL command offers three parameters, all of which are
optional:
1. The first parameter is a letter or digit specifying the protocol
to use for the download. The letter should be the same one used
in the protocol menu, e.g., X=Xmodem, K=Kermit, etc. If you do
not specify a protocol letter, the current default protocol will
be used. Example: \DLY[] would invoke the Download Window with
Ymodem as the default protocol selection.
2. The second parameter is an optional - minus sign. If you include
the minus sign, then BOYAN will bypass its Download Window where
you confirm the protocol, path, and filename; the download will
begin immediately. Example: \DL-[] is used in Auto-macro #12
so that auto-downloads start without any keypresses on your part.
5.2.13: BOYAN Power--Macros and Script Files 97
________________________________________________________________________
3. The third parameter, enclosed in brackets, is the full name of
the file to download. You may also specify a path only (but no
filename), or leave the brackets empty. If you do not specify a
filename, BOYAN will use its automatic filename-find feature to
determine the name. (Some external protocols determine the
filename automatically, in which case you may leave the brackets
empty.) If you do not specify a filename and BOYAN cannot
determine the name from the screen, BOYAN will name the file
FILE####.BDL, where #### is the time of day when the download
started. Examples: \DL-[twiddle.zip] will immediately begin
downloading twiddle.zip into your default Download directory.
\DL[%S:] will direct a download to your BOYAN script directory,
prompting you for the filename.
\DP[c] \DP[K]
%DP K
Default Protocol. This sets the default file transfer protocol. Put
the first letter of the protocol (A, C, K, X, Y, Z, etc.) in the
brackets. The current default protocol's letter is always stored in
variable %DP.
\IP+c[macro] \IP+K[\DLK[] | \DLX[]]
\IP-c[macro] \IP-Z[\DM[Zmodem not installed.]]
If Protocol available? The \IP+ command processes the enclosed macro
only If the Protocol specified by the character c is available. The
first example above performs a Kermit download if the Kermit protocol is
available, or an Xmodem download otherwise. The \IP- command processes
the enclosed macro only if the specified protocol is not available.
\IT+[macro] \DLy[]\IT+[\DM[Ymodem download successful.]]
\IT-[macro] \ULk[boyan5a.zip]\IT-[\DM[Upload failed.]]
If Transfer successful? The \IT+ command processes the enclosed macro
only If the most recent file Transfer completed successfully. The \IT-
command processes its macro only if the last transfer was unsuccessful.
%P: D:\BOYAN\EXTPROTS\
Protocol path. This variable holds the full name of the external
protocol program path, configured in Configuration Area <D>.
%T: C:\MODEM\DL\
%TF TWIDDLE.ARC
Transfer path, Transfer Filename. The %T: variable stores the name of
the most recent directory selected for a file transfer; %TF holds the
name of the file most recently selected to be transferred.
%TI Ymodem DL: ALLFILES.ARC 44,160 0:04:36 67.4%
Transfer Information. After a file transfer, BOYAN builds an
information string like the one above. The string consists of the
protocol used, UL or DL, filename, file size, transfer duration, and
5.2.13: BOYAN Power--Macros and Script Files 98
________________________________________________________________________
efficiency percentage. If the transfer is unsuccessful, the word
(FAILED) follows the filename. This string can be included in the usage
log, for example, as in Auto-macro #8 ("After a file transfer").
%UD UL
UpLoad or DownLoad? This variable holds "UL" after an upload or "DL"
after a download.
\ULc-[filename] \UL-[c:\modem\files\twiddle.arc]
UpLoad. The use of this command, UpLoad file, is analogous to the use
of the \DL command. The protocol letter (c), minus sign, and filename
parameters are all optional. If BOYAN cannot find the file for
uploading, however, the upload will be aborted.
\WW+ \WW- \WW*
Word Wrap. \WW+ enables, \WW- disables, and \WW* toggles the automatic
word wrap handling feature of message uploads.
5.2.14 User Variables
%V0 %V1 ... %V9
%VA %VB ... %VZ
These 36 user-definable variables, along with the following macro
commands, give the macro language enormous power. A user variable can
hold a string, a number, or a macro.
\DVc[x] \II+;,%V0[\DV0[%II]]
Deletes the leading x characters from the specified user Variable. For
example, \SV0[Justin] \DV0[3] results in %V0 being set to "tin". The
more complicated example above has the effect of deleting all characters
up to the first semicolon in %V0. Combined with the \LV command, this
command lets you pick out any substring from within a variable. (See
HOST.BSC for many examples.)
\GVc[filename] \RE[ \GV5[FOO.DOC] %V5{ \IV5+^Z[\EM] ]
\GVc[] \GV5[]
Get Variable from file. This command reads from an ASCII file into a
user variable. Each successive call to \GV1[foo.txt] reads one more
line from the specified file foo.txt. If you switch to another
filename, e.g., \GV3[bar.doc], then foo.txt will be closed and the first
line of bar.doc will be read. When you reach the end of the file, the
user variable will contain the control-Z (EOF) marker. The example
given above actually performs an ASCII upload of FOO.DOC: the macro
repeatedly gets a line of text from FOO.DOC into %V5, then sends %V5 +
<CR> over the modem, and checks to see if the ^Z marker was reached. It
is a good idea to close any files opened this way by using the \GVc[]
command.
5.2.14: BOYAN Power--Macros and Script Files 99
________________________________________________________________________
\IVc+string[macro] \IV5+secret[Welcome! | Wrong password.]
\IVc-string[macro] \IV0-[\DM[Input accepted.]]
If Variable equals? The \IV command tests whether variable c equals
string. \IVc+string[macro] is actually just a shortcut for
\IE+%Vc,string[macro] , and similarly with \IVc-. The first example
sends the "Welcome!" message if %V5 equals "secret", or the "Wrong
password" message otherwise. The second example tests to see if %V0
equals the empty string--that is, if %V0 is empty. If not, then the
"Input accepted" message is displayed.
\KVc[string] \KV0[Your selection?]
\KVcstring1[string2] \KV8%DR[New disk drive: ] \ND[%V8:]
Keyboard Variable. This command lets you make BOYAN's macros and
scripts interactive. BOYAN prompts you for keyboard input on the status
line; what you type is stored in variable c. The string in brackets is
the prompt; e.g., the first example above prompts the user with "Your
selection?". You can specify a default response to the prompt by
placing another string before the first left bracket. The second
example above uses the %DR variable to make the default response the
current drive letter; it then uses the \ND command to change to the new
drive letter typed by the user. Note: when responding to a \KV prompt,
you must press <Enter> after typing your response, unless the default
response is one character long. If the default response is a single
character, BOYAN expects a keyboard response of only one character, and
does not require you to press <Enter>. In the second example above,
since the current drive letter %DR is always just one character, the
user does not have to press <Enter> after responding.
\LVc[x] \SV1[%B:]\LV1[2]
\LVc[] %LV \LV5[] \ST[Length of %V5 is %LV.]
Length of Variable. This command allows your macros to perform basic
string manipulation. If a numeric argument x is given, \LV sets the
length of variable c to be exactly x (0..80) characters, padding with
spaces if needed. In the first example above, %V1 is set to the BOYAN
directory (e.g. "C:\BOYAN"), and then truncated down to two characters
so %V1 = "C:". The %LV variable holds the new length of the variable.
If no argument is enclosed in the brackets, then the length of the
string is left unchanged. The second example above demonstrates how to
find the length of a variable's contents without changing the variable.
\RVc[y] Please type your name: \RV1[30]
\RVc*[y] Please type your password: \RV2*[20]
\RVc-[y] \WF[Time left:] \RVT-[20]
\RVc+[y] \RVL+[70]
Read Variable. This command is used to read input from the modem into
user variable c. Up to y characters are accepted, and the entry must be
terminated by a <Return>. Backspacing is allowed and handled properly.
With the * parameter, BOYAN echoes asterisks rather than the actual
typed text back to the modem. With the - parameter, BOYAN echoes
5.2.14: BOYAN Power--Macros and Script Files 100
________________________________________________________________________
nothing at all; this can be used to read prompts from a BBS into a user
variable. Finally, the + parameter tells BOYAN to "read with word
wrap": if the input text exceeds the given maximum length y, then the
previous word of input will be erased and saved for the next \RVc+
command. See the HOST.BSC script for many examples of how \RV is used.
\SVc[string] \SV4[The current time is %HR:%MI:%SE.]
Set Variable. This command lets you Set user Variable c. The example
above sets variable %V4 equal to a message containing the current time.
\TVc[y] \TV1[84]
Terminal keyset macro into Variable. This command is analagous to the
\MV command, moving the contents of BOYAN Secondary Keyset macro # y
(41..110) into user variable c.
\+Vc[y] \SV1[68] \+V1[34] \DM[ 68+34 = %V1 ]
Plus Variable. This command lets your macros perform basic arithmetic.
The number y is added to the contents of user variable c, and the result
is again stored in variable c. To perform subtraction, let y be a
negative number, e.g. \+V1[-34]. The valid range for numeric data is
-10000..10000. In the example above, the \+V1[34] command changes the
value of %V1 from 68 to 102.
5.2.15 Macro Control
\\string \DL[] \\ that command downloads a file
(Macro comment) BOYAN ignores all characters in a macro after the \\
command. Use this to insert remarks in a macro. BOYAN also ignores any
spaces which immediately precede the "\\", so that you can use spaces to
align comments in a script file. The above example has the same effect
as "\DL[]" alone.
\AB \KV2Y[Continue? ]\IV2+N[\AB]\DM[Continuing...]
ABort current macro (or script file) processing. The example prompts
the user with the "Continue?" prompt. If the user responds "N", the
macro or script is aborted, and none of the following commands are
processed.
\AT+[macro] \AT+[\MM]
\AT-[macro] \AT-[\PM[Script file %CS is running.]]
ATtended? The \AT+ command processes the enclosed macro only if BOYAN
is attended, that is, if there is no script file running. The \AT-
command processes the enclosed macro only if BOYAN is not attended--when
a script file is running.
\EM \RE[ \DM[ %RE ] \CA+[\EM] ]
End Macro: stops the current macro; if in a script file, advance to the
next line of the script. This command is most often used to break out
of an infinite REpeat loop. In the example above, BOYAN displays a
5.2.15: BOYAN Power--Macros and Script Files 101
________________________________________________________________________
running counter until the CArrier signal is detected, at which point the
\EM command breaks the loop.
\IE+string1,string2[macro] \IE+%UD,DL[\DM[File downloaded.]]
\IE-string1,string2[macro] \IE-0,%DS[\JD|\ST[Can't jump to DOS.]]
If Equal? The \IE command tests the equality of string1 and string2.
\IE+ processes the enclosed macro if the strings are equal; \IE-
processes its macro only if they are not. The first example above
displays the "File downloaded" message if the last file transfer was a
download (the %UD variable would equal "DL"). The second example jumps
to DOS if the amount of DOS Shell space (%DS) does not equal 0, and
writes a status message if %DS does equal 0. Case is NOT significant,
so ibm-PC matches Ibm-Pc.
\II+string1,string2[macro] \II+Put,Computer[\DM['Put' found at position
%II.]]
\II-string1,string2[macro] \II-PCA,%V6[\DM[Error: %V6 should contain
'PCA'.]]
%II %IM \II+;,%V8[\LV8[%IM]]
If Included? The \II command tests If string1 is Included as a
substring of string2, as "Put" is a substring of "Computer". \II+
processes its macro if string1 is included in string2; \II- processes
macro if string1 is not in string2. The %II variable returns the
numeric position within string2 where string1 was found, if \II+ was
successful, so the first example macro above displays the message,
"'Put' found at position 4". The %IM macro simply equals %II Minus one.
This is used in the third example above to truncate %V8 at the position
where a semicolon was found; e.g., if %V8 = Justin Boyan;ibm-pc, then
processing the \LV8[%IM] macro leaves %V8 = Justin Boyan.
\IK+[macro] \ST[Press any key: _] \RE[\IK+[\EM] ]
\IK-[macro]
%IK \IE-%IK,Q[\MA[61] |ELSE \AB]
If Keypressed? \IK+ runs its enclosed macro only if a key has been
pressed during the operation of the current macro or script block. \IK-
runs its enclosed macro if no key has been pressed. The %IK variable
always holds the last character typed by the user. The first example
above repeatedly checks for a keypress, ending the macro once you press
a key. The second example runs macro #61 if the last key you pressed
was q; if the last key you pressed was not q, then the macro/script is
aborted. Compare %IK with the \KV macro command described in section
5.2.14. The difference is that \KV stops macro processing to wait for
user input, while %IK checks to see if you have typed anything while the
macro is running.
\MA[x] \MA[9]
MAcro. This invokes BOYAN macro # x (1-120). For example, the macro
command \MA[9] runs the initialization Auto-macro; \MA[38] invokes the
<Alt-X> (exit BOYAN with verify) macro.
5.2.15: BOYAN Power--Macros and Script Files 102
________________________________________________________________________
\REx[macro] \RE5[\WF[]]
\RE[macro] \ST[Waiting for carrier...] \RE[\CA+[\EM]]
%RE \RE24[\DM%RE[Hi there!]]
REpeat macro. If a number x (1..32767) is given before the left
bracket, then the enclosed macro will be executed x times. The first
example above would wait for five characters to arrive from the modem.
If no number is specified, the enclosed macro is repeated indefinitely.
To break out of such an "infinite loop," the enclosed macro must contain
an ABort, End Block, or End Macro command (or the user can abort by
pressing <Esc>). Above, the \CA+[\EM] command is used to break out of
the repeat loop as soon as the carrier signal is detected. The %RE
variable holds the counter number of the innermost repeat loop. In the
third example above, the message "Hi there" is displayed on line 1, line
2, line 3, ... all the way to line 24.
5.2.16 Miscellaneous
\CB[] \AT+[\CB[]]
\CB[c] \CB[T]
Configure BOYAN. \CB[] invokes BOYAN's main configuration menu. If you
specify a letter (any of S C D E M A T X) within the brackets, BOYAN
will jump directly to the specified Config Area. The configuration
choices must be made from the keyboard, so do not run this macro unless
the keyboard is attended.
\EX \KV0Y[OK to exit? ]\IV0+Y[\EX]
EXit BOYAN immediately! A macro like the one above may be used to make
the user confirm that he wants to exit.
\HE
HElp. This invokes BOYAN's main help screen, the BOYAN Command Menu.
\HK
Help with function Keys. This calls up BOYAN's screen of user-defined
function key descriptions.
\RB
Review Buffer. This calls up the scroll-back buffer for viewing, script
learning, etc.
\SK+ \SK- \SK* %SK
Secondary Keyset (Scroll locK). \SK+ sets Scroll-Lock ON, activating
the Secondary Keyset of the current BAM. \SK- turns Scroll-Lock OFF,
\SK* toggles Scroll-Lock, and %SK returns Scroll-Lock's current status
(ON or OFF).
5.2.16: BOYAN Power--Macros and Script Files 103
________________________________________________________________________
\SMx[string] \SM1[ATDT 9,"@SF"{]
Set BOYAN Macro # x to the specified macro. This new macro is saved to
the BOYAN.MAC file, just as if it were reconfigured in Config Area <M>.
The example sets macro #1 (the Dialing command) to ATDT 9,@SF{ which is
useful for dialing out from Centrex-type phone extensions.
\TMx[string] \SN101["\HK]
Set BOYAN Terminal Keyset Macro # x (41..110) to the specified macro.
This new macro is saved to the .CNF file corresponding to the current
BAM, e.g., VT-100.CNF, HOST.CNF, etc. Also see the \TV command above,
which reads a macro from the secondary keyset into a user variable.
5.2.17 <Shift-F1> Trace Mode
BOYAN's macro language provides a "trace" feature which can help you
learn how a macro works or discover why a macro or script is not
working. When Trace Mode is on, the middle of the Status Line always
displays the two letters of the current macro command being processed.
(When sending text to the modem, you will see a small arrow rather than
two letters.) In addition, while a script file is running, the Status
Line will indicate the current line number of the script being
processed.
An especially handy feature is the ability to slow down and speed up the
script dynamically, as the script is running. When the Num-Lock toggle
is not locked, the macro or script being traced will race along at
normal speed. At this speed it is impossible to follow the trace output
closely. When Num-Lock is locked, however, BOYAN pauses for
approximately one-half second between displaying the macro's name and
actually executing it. You may turn Num-Lock on and off at any time
while a script is running.
\NK+ \NK- \NK* %NK
Num locK. \NK+ sets Num-Lock, \NK- unsets Num-Lock, \NK* toggles Num-
Lock, and %NK returns Num-Lock's current status (ON or OFF). A handy
debugging tool is to insert the \NK+ command at the position in your
script where you are having trouble. When the script gets to precisely
that point, it will slow down so that you can follow the Trace Mode
output.
\TR+ \TR- \TR* %TR
The \TR+ and \TR- macros are used to actually turn Trace Mode on and
off. \TR* toggles the Trace Mode, and %TR reports the current status
(ON or OFF).
5.3: BOYAN Power--Macros and Script Files 104
________________________________________________________________________
5.3 BOYAN Macro Tutorial, Examples
The best way to learn how BOYAN's macros work is to experiment: write
one, and see what it does! The <Alt-M> "Enter macro manually" command
is useful for trying out a short macro. Many example macros have
already been given, next to the descriptions of all the macro commands.
The following additional examples illustrate how BOYAN's 120 built-in
macros give you flexibility unlike any other communications program. To
edit the BOYAN macros, press <Alt-K>. You can then choose a macro for
editing by either typing its number (1-120) and pressing <Enter>, or in
the case of keystroke macros, simply pressing the keystroke (such as
<F2>) itself. For a review of basic macro editing, please see section
3.9.4.
Don't worry about destroying BOYAN's original macros while you
experiment. You can always restore all of the preset macros by simply
deleting the BOYAN.MAC file from your disk and starting BOYAN over.
5.3.1 Built-in Keystroke Examples
This section studies some of the built-in BOYAN keystroke macros to show
you how they work and to aid you in modifying them if you like. They
are ordered roughly from simplest to most complex.
> <F2>: Send your name + <Enter> <
Macro #72: Justin Boyan{
The simplest kind of macro! The left curly brace stands for the <Enter>
or <Return> character.
> <F3>: Send your password + <Enter> <
Macro #73: %PW{
When you a dial a system from the dialing directory, that system's
private password is stored in BOYAN's %PW variable. This key macro
sends that password and the <Return> character over the modem.
> <Alt-F10>: Display current time and date <
Macro #110: \ST[It is now %HR:%MI:%SE on %MO/%DA/%YR.]
The \ST[..] macro command displays a string on the Status line. This
example shows how Macro Variables may be used in such a string.
> <Alt-N>: New disk directory <
Macro #28: \KV0%C:[NEWDIR: ] \ND[%V0] \ST[%C:]
This example shows how BOYAN's interactive macros work. First, the
macro uses the "\KV#default[prompt]" command to prompt the user for
input. In this case, the user's prompt is "NEWDIR: "; the default
response is %C:, a variable which returns the name of the current disk
directory; and the user's final response is kept in user variable #0.
5.3.1: BOYAN Power--Macros and Script Files 105
________________________________________________________________________
Then, the \ND[%V0] command switches to a New Directory given by %V0.
Finally, the \ST command displays a status message, consisting of simply
the (new) current disk directory.
> <Shift-F1>: Toggle BOYAN's "Trace Mode" <
Macro #39: \TR* \ST[Macro trace mode now %TR]
First, the \TR* command has the effect of actually toggling the Trace
Mode setting. Then, a status message is displayed which includes the
new value of the Trace Mode variable %TR, either ON or OFF. This macro
is typical of BOYAN toggle commands. (The trace mode itself is very
useful for understanding macros and scripts; see section 5.2.17.)
> <Alt-L>: Toggle Disk Logging <
Macro #26: \IE+OFF,%LD[\KV0%LN[Log to: ]] \LD*[%V0] \ST[Logging now %LD]
This is another toggle command like <Shift-F1>, but it inserts an extra
conditional command at the beginning. The conditional (If Equal)
command checks if logging to disk (%LD) is equal to OFF. If so, then
the \KV command prompts the user for a filename to "Log to", giving the
default log name (%LN) as a default.
> <F6>: View usage log <
Macro #76: \DC[%LC %UN]
This macro uses the \DC[..] macro to execute a DOS Command. The %LC
variable names your file lister program (specified in Config Area D).
The %UN variable contains the name of your usage log file. Putting
these together, the DOS command that <F6> executes looks like "LIST
C:\BOY5\BOYAN.USE". Similarly, you can assign any DOS command to a
single keystroke.
> <Ctrl-F1>: View the BOYAN.DOC file, this user's manual <
Macro #81: \SV0[%B:BOYAN.DOC] \FE+%V0[\DC[%LC %V0] | \ST[File not
found.]]
This macro adds complexity to the <F6> example above because it checks
that the file exists before trying to view it. In this case, the file
to be viewed is BOYAN.DOC, which if it exists is assumed to live in your
BOYAN home directory (specified by %B:). Here's how the macro works.
First, it sets user variable 0 to hold the full name of the file,
%B:BOYAN.DOC. Then it uses the \FE+ macro to check that the file
exists. If it does, the macro calls DOS to list the file; otherwise
(|), it prints a "File not found" status message.
> <Alt-V>: View file using File Manager <
Macro #36: \( \KV0[VIEW: ] \RS \IV0+[\FMV[] |ELSE \DC[%LC %V0]]
Macro #119: \KS \DM1,24[ (Leave blank for directory.) ]
If a key macro is too long to fit in the space provided, one solution is
to break it up into two separate macros. The <Alt-V>, <Alt-R>, and
<Alt-W> key macros all make use of macro #119, the \( Shortcut macro.
This shortcut does two things: it stores an image of the current screen
in memory (\KS), and it displays a brief message on line 24. After
5.3.1: BOYAN Power--Macros and Script Files 106
________________________________________________________________________
invoking the shortcut \(, the <Alt-V> macro prompts the user for a
filename, and then restores the screen (\RS), thus un-displaying the
"Leave blank for disk directory" message. Finally, the \IV0+[...]
command tests whether the user's response (%V0) was empty. If it was,
then the File Manager is invoked with "View" as the default selection
(\FMV[]); otherwise, the <Alt-V> macro calls DOS to view the file
immediately.
5.3.2 Auto-macro Examples
> Clear screen automatically before dialing <
Macro #1: \ZS ATDT@SF{
BOYAN dials a number by simply executing Macro #1, the dialing command.
The @SF variable is used to insert the System FON number into the
command. To make BOYAN automatically clear the terminal screen before
dialing, just insert the command \ZS (Zap Screen) into macro #1.
> Remove same-named systems from Queue after connect <
Macro #6: \UM[%SN (%MS baud): %SF] \QA-[%SN]
When you connect to a system, BOYAN automatically deletes that system
from the Redialing Queue. However, by appending the \QA-[%SN] command
to macro #6, you instruct BOYAN to also delete from the Queue any other
systems with a similar System Name. For example, suppose you have
systems named "Bob's BBS Line 1", "Bob's BBS Line 2", and "Bob's BBS
Line 3" all in the Queue. When you connect to any one of those systems,
this macro will automatically remove all three systems from the Queue.
> Eliminate the "squawk" BOYAN makes after disconnecting <
Macro #7: \RC \SK- \UM[| Disconnected after %SL]
Simply delete the \AL3[0] command from the "After disconnecting"
Auto-macro (#7).
> Automatically return to dialing directory after disconnecting <
Macro #7: \AL3[0] \RC \SK- \UM[| Disconnected after %SL] \DI[]
As soon as the connection's carrier signal is lost, BOYAN executes its
Auto-macro #7. By adding the command "\DI[]" to the end of macro #7,
you instruct BOYAN to automatically invoke the dialing directory after
disconnecting.
> Automatically log all sessions to disk <
Macro #6: \UM[%SN (%MS baud): %SF] \LD+[%B:BOYAN%S#.LOG]
Macro #7: \AL3[0] \RC \SK- \UM[| Disconnected after %SL] \LD-
If you add these \LD commands to Auto-macros #6 and #7, BOYAN will
automatically maintain a separate, permanent log file for each dialing
directory entry. The log files will be stored in the BOYAN home
directory (%B:) and named BOYAN1.LOG, BOYAN2.LOG, ... BOYAN200.LOG,
depending on the system's entry number in the dialing directory (%S#).
The appropriate log file is opened by Macro #6 whenever you make a
connection and closed by Macro #7 (\LD-) as soon as you disconnect.
5.3.2: BOYAN Power--Macros and Script Files 107
________________________________________________________________________
Thanks to Auto-macro #14 (the "Log file init macro"), a header line will
separate the sessions within each system's log file.
> Log each day's sessions to a dated disk file <
Macro #9: ATX4S0=0{ \LD+[%B:%MO-%DA-%YR.LOG]
Unlike the previous example, where the name of the log file depends on
which system you call, this example opens a log file whose name depends
on the current date. Every time you start BOYAN, this start-up macro
(#9) will open a log file in the BOYAN home directory (%B:) named by the
current date, e.g., 05-28-92.LOG on May 28, 1992. BOYAN's conclude
macro contains the \LD- command, so the log will be closed when you exit
BOYAN.
> Automatically fill the redialing queue at BOYAN start-up <
Macro #9: \DM[ Welcome to BOYAN! ] ATX4S0=0{ \QA[1] \QA[4] \QA[5]
Suppose you dial systems 1, 4, and 5 in your dialing directory every
time you use BOYAN. If you append the commands \QA[1] \QA[4] \QA[5]
to the BOYAN start-up macro (#9), then those three systems will
automatically appear in the redialing queue. You could also append
either of the \QE (enter redialing queue) or \QD (begin queue redialing)
commands.
> Report the current Action Module name at start-up <
Macro #9: ATX4S0=0{ \ST[Using Action Module: %AN]
After initializing the modem with ATX4S0=0 <Return>, this BOYAN start-up
macro will display a status message such as "Using Action Module:
VT-100". The %AN variable holds the name of the current action module.
> Get path confirmation before starting auto-download <
Macro #12: \AT+[\DL[]]
Remove the "-" from the default Auto-download macro to make BOYAN wait
for you to confirm the download path before beginning an auto-download.
> Dial multiple systems in the middle of the night <
Macro #99: \QC \QA[Joe] \QA[Liz] \QA[Bob] \PU[3] \QU[6]
Macro #7: \UM[| Disconnected after %SL] \QU[6]
Let's see how these work. Macro #99 corresponds to the <Shift-F9> key.
The first thing that happens when you press <Shift-F9> is that the queue
is cleared. Then, the \QA command adds systems to the queue from the
Dialing Directory. \PU tells BOYAN to Pause Until 3:00 am, at which
point \QU will tell BOYAN to begin Queue redialing--but to give up at 6
am if no connection has been made.
If a connection is made, however, then Macro #99 will finish, and the
auto-logon script for that system (say, JOE.BSC) will take over. This
script might read your mail on Joe's BBS and capture it to a file, for
example (see section 5.5). At some point, JOE.BSC logs you off from the
BBS. Here's where macro #7, the "After Disconnecting" Auto-macro, comes
into play. As soon as the carrier signal drops, Macro #7 wakes up,
5.3.2: BOYAN Power--Macros and Script Files 108
________________________________________________________________________
records a message in the usage log, and begins redialing again with the
\QU command. The systems that remain in the queue (Liz and Bob) will be
handled just like Joe's, as soon as a connection is made. At 6 am,
queue redialing will stop, even if there are some systems which haven't
yet been reached.
5.3.3 Yet More Key Examples!
> Make <Home> call up the BOYAN Command List <
Macro #45: \HE
> Make left mouse button invoke the Dial Directory <
Macro #11: \DI[]
> Make left mouse button run the MOUSMENU.BSC script <
Macro #11: \SC[MOUSMENU]
This demonstrates how you can link the mouse button (or any function
key) directly to a script file.
> Make <Alt-D> offer a "Quick-Dialing" bar <
Macro #18: \KV0[DIAL: ] \DI[%V0]
If you alter the <Alt-D> keystroke macro (#18) as above, then instead of
going straight to the Dialing Directory, <Alt-D> will prompt you with
"DIAL:" on the Status Line. First, the \KV0 command requests your
input, storing what you type in user variable %V0. Then the \DI[%V0]
command dials that number, whether it is the name of a system from the
Dialing Directory, the code number of a system from the directory, or a
full phone number entered manually. If you typed only <Enter>, then %V0
would be empty, so \DI[%V0] conveniently would invoke the Dialing
Directory.
> Make <Alt-0> "Kill" all BOYAN sound effects <
Macro #69: \BB- \AV[0] \ST[Sound effects Killed.]
Now the <Alt-0> command (macro #69) will both turn Beeps & Bells off and
set the Alarm Volume to 0. As a friendly touch, it will also display a
status message.
> Make <F9> invoke your editor on the last script file run <
Macro #79: \DC-[%WC %S:%SC]
This macro makes a handy command by combining three macro variables:
%WC, which holds the name of your word processor/text editor; %S:, the
script directory, and %SC, the last script file run. It concatenates
them to form a string such as "QEDIT C:\BOY5\SCRIPT\CIS.BSC", and then
executes that string as a DOS Command. The - in \DC- tells BOYAN not to
wait for you to press a key after returning from the editor.
5.3.3: BOYAN Power--Macros and Script Files 109
________________________________________________________________________
> Make <PgUp> remember the directory of the last upload <
Macro #47: \UL[%T:]
BOYAN's normal upload macro, \UL[], chooses your Upload Directory (as
specified in Config Area <D>) as the default path to search for the
upload filename. This macro tells \UL to search the path given by %T:
instead, where %T: stores the path used by the previous file transfer.
> Make <End> reset the current modem port <
Macro #46: \CD[%MD]
The trick is to tell BOYAN to "change devices" to the current modem
device--resetting the device in the process. This is what the <End>
keystroke macro (#45) above does. Running certain external programs may
cause the port to "lock up"; if that happens, running this macro (by
pressing <End>) should fix the problem.
> Make <Alt-F5> toggle the "GOSSIP" Action Module <
Macro #105: \IE-%AN,GOSSIP[\AM[G] |ELSE \AM[%AP]]
The \AM macro command selects a new BOYAN Action Module; for example,
\AM[G] invokes BOYAN's Gossip Mode. The <Alt-F5> keystroke macro (#105)
presented above is more sophisticated: if you are already in Gossip
mode, pressing <Alt-F5> again will return you to your prior Action
Module. Here's how it works: the \IE- command checks to see If the
current Action module Name, %AN, is not Equal to "GOSSIP". If they are
not equal, then the Gossip Mode is invoked by "\AM[G]". Otherwise, if
GOSSIP is the current name, then the previous module is invoked with
"\AM[%AP]". (The %AP variable remembers the previous Action module
letter.)
> Make <Ctrl-F8> view the contents of a ZIP file <
Macro #88: \FM`pkunzip -V[*.ZIP]
This macro invokes the File Manager on all .ZIP files in the current
directory. The default command for the File Manager is given as
PKUNZIP -V, which is the DOS command to view the contents of a ZIP file.
> Make <Ctrl-F9> build a ZIP of selected files <
Macro #89:\FML[] \KV0[Build zip:] \DC-[pkzip %V0 "@boymark.lst]
\ST[Done!]
First, this macro invokes the File Manager with the List command as
default. While in the File Manager, you may use the <space> key to mark
files, and then <Enter> to list those files to the BOYMARK.LST file.
The macro then prompts you for the name of the .ZIP file to build, and
invokes the DOS Command PKZIP @BOYMARK.LST to actually build the .ZIP
using the filenames in BOYMARK.LST.
> Make <Shift-F10> turn BOYAN into an alarm clock <
Macro #100: \KV0%HR:%MI[Set alarm: ] \UT%V0[\DM[ %HR:%MI:%SE ]] \AL2[3]
This macro uses several advanced commands. The first command,
\KV0%HR:%MI[Set alarm: ], requests keyboard input into user variable %V0
with the prompt, "Set alarm: ". A default of %HR:%MI, the current time,
5.3.3: BOYAN Power--Macros and Script Files 110
________________________________________________________________________
is provided. The second command, \UT%V0[\DM[ %HR:%MI:%SE ]], loops
Until the Time has become %V0--which is the time read in from the
keyboard. During each loop it Displays a Message of the current time on
the screen. When the \UT loop finally finishes, the third command,
\AL2[3], rings an alarm (type 2) for three seconds.
* * * *
The macros above are just a small sample of the range of flexibility
BOYAN's built-in macros can offer. If you write a clever macro, please
submit it for inclusion in the next edition of this manual!
5.4 The BOYAN Command Line
Normally, you run BOYAN by issuing the simple command BOYAN from DOS.
BOYAN's first step is to execute Auto-macro #9, the BOYAN start-up
macro. However, in some cases, you may wish to avoid BOYAN's start-up
macro. BOYAN allows you to specify an alternative start-up macro when
invoking BOYAN, directly from the DOS command line. For example, if you
ran BOYAN with the DOS Command BOYAN ATZ{ , then BOYAN would send the
ATZ <Return> modem string, rather than executing macro #9. If you
invoked BOYAN by typing BOYAN \DI[Boyan Support] , then BOYAN would
immediately dial the specified number. If you ran BOYAN with the
command BOYAN \\ , then BOYAN would do nothing at all at start-up
(bypassing its normal start-up macro), since \\ signifies only a macro
comment. This might be useful if you were already on-line before
invoking BOYAN.
Another application of the command line macro feature is that BOYAN can
be run from a batch file. For example, a batch file could invoke BOYAN
with the command, BOYAN \MA[9] \SC[NIGHT] . At start-up, BOYAN would
first run macro #9 (the normal start-up macro), and then execute the
NIGHT.BSC script file.
Your DOS command line may also specify the amount of memory BOYAN should
reserve for the DOS Shell. For example, type BOYAN 100 to have BOYAN
reserve 100K of memory for the Shell. A start-up macro could follow the
memory specification; e.g., BOYAN 100 \MA[9] \DI[Boyan Support] would
make BOYAN reserve 100K of memory for DOS, execute its normal start-up
macro, and finally dial the Boyan Support BBS.
5.5: BOYAN Power--Macros and Script Files 111
________________________________________________________________________
5.5 Script Files
BOYAN script files can be created by any text editor or word processor
which can edit standard text files--for instance, the EDLIN editor which
comes with DOS, or the SideKick notepad. Script files must be named
with a suffix of .BSC, and should be placed in the default BOYAN script
directory (although that is not mandatory).
The simplest kind of script file is just a sequence of BOYAN macros.
BOYAN processes such a script file by sequentially evaluating each line
of the file as a macro, until it reaches the end of the file. Blank
lines are ignored. This is the type of script created by BOYAN's auto-
matic Script Learn facility.
In more complex script files, you may organize the sequence of macros
into as many as 500 "blocks." The start of a block is defined by a
line of text which begins with the vertical bar | symbol (shift-
backslash) plus a block label. Labels can be as long as you wish, but
only the first eight characters are significant, e.g., MessageReply
and MessageRead are equivalent labels. Since case is not significant,
|LOGON and |LogOn also refer to the same block. All macros following a
block label are considered a part of that block until either another
block label or the end of the file is reached.
5.5.1 Script-specific Macro Commands
The Macro Programming Language provides several additional commands
specifically for power in script files. These commands allow BOYAN
scripts to use looping, block nesting, and even recursion.
\AB
ABort. Aborts all current script files, just as if you had pressed the
<Esc> key. If the script has a block named *WRAPUP in it, that block
will be executed before you are returned to terminal mode (see section
5.5.4).
\BL[label] \BL[LogOn]
BLock. Calls the block with the specified label. When that block has
completed, control is returned to the calling macro.
\EB \IF+end of messages[\EB]
End the current Block. You can use this within a conditional statement
to end the block prematurely. See also \EM (End Macro).
\GB[label] \GB[LogOn]
Goto Block. Go directly to the block with the specified label. When
the end of that block is reached, the script is finished; control is not
returned to the calling macro.
5.5.1: BOYAN Power--Macros and Script Files 112
________________________________________________________________________
\GS[filename] \GS[rbbs]
\GS[filename;label] \GS[rbbs;messages]
Goto Script. Go directly to the script with the specified filename
(.BSC suffix assumed). If a semicolon and label are given, the
specified block of the script is executed; otherwise, the entire script
runs from start to finish.
\KO[x] \KO[0]
Keyboard timeOut. Set the unattended keyboard timeout to x seconds. If
BOYAN requires keyboard input while a script file is active, it will
wait x seconds for the user to manually respond. If there has been no
keyboard response after x seconds, BOYAN goes ahead using the default
response. After the \KO[0] command, for example, BOYAN automatically
accepts the default response immediately.
%S: D:\BOYAN\SCRIPT\
%SC PCBOARD.BSC
Script path. The %S: variable contains BOYAN's script file disk
drive+path; %SC holds the name of the currently active (or most
recently active) script file.
\SC[filename] \SC[rbbs]
\SC[filename;label] \SC[rbbs;LogOn]
SCript. Invoke the script with the specified filename (.BSC suffix
assumed). If a semicolon and label are given, the specified block is
executed; otherwise, the entire script runs from start to finish. When
that script has completed, control is returned to the calling macro. If
the filename is not preceded by a DOS pathname, BOYAN assumes that the
script file is located in the default Script directory.
5.5.2 Automatic Logon Scripts
In section 4.7.3.1, you saw how BOYAN's Script Learn Facility could be
used to write scripts for automatic logging-on to a system. BOYAN
allows a completely hands-free logon through its dialing directory
Script field. Using the Edit command in the dialing directory, you can
assign each entry a 1-8 character script name, like PC-BOARD or
MCIMAIL . The next time you connect to the system using the <Alt-D>
Dial or <Alt-Q> Queue Redial commands, BOYAN loads the specified script
file (the .BSC suffix is automatically added). It then searches for a
block labeled |LOGON. If there is a |LOGON block in the script, then
only that block is executed. Otherwise, the entire script is processed
from beginning to end.
5.5.3: BOYAN Power--Macros and Script Files 113
________________________________________________________________________
5.5.3 Running Script Files
BOYAN can automatically process a logon script file after making a
connection. However, you may often need to run a script at some other
time. BOYAN provides a number of convenient methods for executing
either an entire script file or just a single block from a script file.
When specifying a script file, you may include the script's directory,
its name (.BSC suffix assumed), and optionally a semicolon and a block
label. For example, the following are all valid script specifiers:
c:\text\menu;DownLoad
This specifies the drive, directory, script name
(MENU.BSC), and block to execute.
RBBS.BSC;LogOn This specifies the LOGON block of the RBBS.BSC
script. BOYAN will search for this script first in
the Script Directory (set in Config Area <D>). If
it is not found there, BOYAN will also look for it
in the current directory.
A:INIT This specifies the A:INIT.BSC script, but no
particular block. BOYAN will run the entire script
from start to finish.
Besides specifying an auto-logon script, you can run a script file in
the following ways:
1. Use BOYAN's <Alt-R> command from terminal mode. Respond to the
"SCRIPT:" prompt with a specifier like any of the three examples
above. If your response is blank, you will be given the chance
to select a script directly from your Script Directory.
2. Select the script file directly from the <Alt-F> Directory File
Manager (section 4.6.1). If the file cursor is over a file with
a .BSC suffix, pressing E will execute the script.
3. Use the \SC[filename;label] command in any BOYAN macro. For
example, you could assign a function key to the macro
\SC[tcomm;DownLoad] . Another use might be to set macro #9
(Start-Up macro) or macro #10 (Conclude macro) to have BOYAN
automatically run a STARTUP.BSC or CONCLUDE.BSC script each time
it starts or concludes. You can also invoke a script file
directly from the DOS command line, as described above in section
5.4.
5.5.4: BOYAN Power--Macros and Script Files 114
________________________________________________________________________
5.5.4 During Script Execution
Once a script file takes control, the BOYAN v5 message in the middle
of the status line disappears, and the script file name flashes in its
place. When this happens, BOYAN is "unattended" and its normal terminal
mode commands are disabled. To regain control before the script file
finishes, you must press the <Esc> key.
The <Tab> key also has a special function during script execution. If
you press <Tab>, the script stops whatever task it is in the middle of
and jumps to the block labelled *TAB. It is as if pressing <Tab>
inserts the command \GB[*TAB] into the middle of your script. The Host
Mode script uses this feature to make the Sysop Menu available at all
times.
Another special script block is the *WRAPUP block. Whenever a script
finishes, either normally or by <Esc>, BOYAN searches for and executes a
block in that script named *WRAPUP. Consult HOST.BSC and ETCH.BSC for
examples of how to use *WRAPUP.
5.5.5 Script Examples
Several sample script files are included on the BOYAN Distribution
Diskettes. These scripts are well-commented, so by studying them, you
can learn a lot about writing your own scripts.
- CIS.BSC is a simple script file for logging on to the CompuServe
Information Service. You must use a text editor to include your own
CompuServe ID in the script file.
- ETCH.BSC demonstrates macro screen control by turning BOYAN into a
computer etch-a-sketch! After invoking this script (with the <Alt-R>
command), use the I,J,K, and M keys to "draw" on the screen. Press
<Esc> to exit the script.
- HOST.BSC contains the complete BOYAN Host Mode. This script is very
complex, using extensive branching, file transfers, DOS commands,
macro arithmetic, and BOYAN Auto-macros. Section 4.8 describes how
to use the Host Mode.
- PCBOARD.BSC is a simple logon script file for the PC-Board type of
Bulletin Board System. It expects that macro #72 (the <F2> keystroke
macro) contains your full name + the { symbol. By configuring this
keystroke macro and entering your password into the Dialing Directory
entry, you do away with the need to edit the PCBOARD.BSC file.
5.5.5: BOYAN Power--Macros and Script Files 115
________________________________________________________________________
- TCOMM.BSC is a logon script file for TComm Bulletin Board Systems.
It also expects your name + { to be stored in macro #72. This script
demonstrates a very flexible method for responding to prompts
regardless of the order in which they arrive.
- VARS.BSC displays the 36 user variables in two full-screen displays.
BOYAN's Trace Mode (section 5.2.17) is a terrific aid in following a
script as it runs. Many other script files written by BOYAN users are
available for downloading from the BOYAN Support BBS.
5.5.6 Technical Notes
5.5.6.1 The Macro Compiler
Macros are automatically compiled as they are run; there is no separate
compiling stage.
When interpreting text enclosed in brackets, the compiler makes a
distinction depending on whether the text is a [string] or a [macro]:
- In a string, the first unquoted right bracket always denotes the end
of the string; in order to include a right bracket inside a string,
you must precede the bracket with a quotation mark. For example, to
make BOYAN WaitFor the "Press [Enter] to continue" message, you must
write:
\WF[Press [Enter"] to continue]
As a string is compiled, all macro variables contained in it are
expanded.
- However, in commands which have a [macro] in their syntax (the \RE,
\UN, \UT, and all conditional commands), the compiler automatically
matches internal brackets. For example, to REpeat (5 times) the
command \RX[1] \RY[1], you would simply write,
\RE5[\RX[1] \RY[1]]
without having to quote the brackets inside. Variables are not
expanded inside macros; for example, the macro
\UT`12:00[\DM[%HR:%MI:%SE]]
displays a running clock on the screen until noon, rather than just
displaying whatever the time was when you first invoked the \UT
command.
5.5.6.1: BOYAN Power--Macros and Script Files 116
________________________________________________________________________
The macro processor ignores spaces and tabs between macro commands. If
you actually want to send a number of spaces to the modem, add a "dummy"
backquote following those spaces, as in
here come five spaces `
Alternatives are to precede each space with a quotation mark, or to use
the macro \CH[32].
5.5.6.2 Variable Prefixes: % vs. @
BOYAN Macro Variables may be referred to with either the % or the @
prefix. When a variable is specified by %, then any special macro
command characters (such as ^ % @ \ ` , etc.) are automatically quoted
with ". When specified by @, no extra quoting is done.
For example, assume that variable V0 holds the string D:\UL. If a macro
referred to that variable as %V0, BOYAN would add a quotation mark
before the \, as it does before every special character. As a result,
BOYAN would send the literal string D:\UL to the modem. It does not
treat \UL like a macro command, but rather like a bunch of characters.
Now, change the % to a @, making the variable @V0. In this case, BOYAN
does not add a quotation mark before the \. It would send the D and :
over the modem and report a syntax error on the \UL macro command.
Thus, one use for the @ variable prefix is to execute the contents of a
variable as if they made up a BOYAN macro. This is why the Dialing
Command refers to the System Fon number as @SF rather than %SF--so that
Shortcut macros, etc. may be used within the phone number. A similar
application of the @ prefix can be seen in the <Alt-M> macro.
Another use of the @ prefix is to force the evaluation of a variable
which is used within another variable. For example, suppose at 1:15 pm
you set V1 and V2 as follows:
\SV1[Time is %HR:%MI]
(This sets V1 = Time is 13:15.)
\SV2[Time is "%HR:"%MI]
(This sets V2 = Time is %HR:%MI.)
If you displayed these variables on the monitor five minutes later, you
would get the following results:
\DM[%V1] displays, Time is 13:15
\DM[@V1] displays, Time is 13:15
\DM[%V2] displays, Time is %HR:%MI
\DM[@V2] displays, Time is 13:20
5.6: BOYAN Power--Macros and Script Files 117
________________________________________________________________________
The automatic quoting done in interpreting %V2 means that %HR is
displayed, not evaluated. In contrast, @V2 substitutes the contents of
V2 directly into the \DM[..] command, so %HR and %MI are evaluated.
********* End Chapter 5 **********