::::::::::::::::::::::::::::::::::::::::::::::::: EXfer: The Extended Transfer Module Version 4.0 ::::::::::::::::::::::::::::::::::::::::::::::::: ; XT: Please enter the type of XMODEM you are using... [1] DOS 3.3 Xmodem [2] ProDOS Xmodem [3] Standard Xmodem [4] No Xmodem, ASCII only XT: Which ? 2 , {You enter "2" to use ProDOS Xmodem.} 001: Public Domain Files + # Filename Typ I Size ( 002 ACOS.PARKER BIN Y 3) 003 ACOS.PARKER.SRC TXT Y 24) 004 ALU BIN N 16) 005 ALU.DOC TXT N 23 [::] ->Receive: DATAFILE XT: Ready to receive... O M {You would now press SA-[S] to tell ProTERM to go into send. You would K Ithen select the "Xmodem ProDOS" send method since that is what EXfer was K Itold to use. Leave the send mode in "File" since a single file is being E Csent. Just press [RETURN] at "Max Retries" to leave them at their D Bdefault. Use the ProTERM file selection system to enter the name K I"DATAFILE". After entering the filename, ProTERM will begin sending the file.} Recapping these steps: 1) Press SA-[S]% 2) Select "Xmodem ProDOS"H 3) Use right or left arrow keys to set "Send Mode" to "File"* 4) Leave "Max Retries" at "10"( 5) Enter "DATAFILE" filename Sending Batch ------------- P NTo send a batch of files use the SA-[S] command. Select the desired protocol P Nand set the "Mode" parameter to "Batch". Next, use the file selection system O Mto enter each file followed by a [RETURN]. As each file is selected it will P Nbe displayed in a third window, to the right of the lower window, in the file P Nselection system. When file selection is complete, use the [ESC] key to exit M Kselection. ProTERM then presents a summary of the files at which time the O Mtransfer may be started or canceled. Once the transfer is complete, ProTERM # will return to the terminal mode. Sending Binary II ----------------- K ITo send a batch of files using the Binary II encoding scheme, select the L JSA-[S] command. Set the "Mode" parameter to "Binary II" and use the file L Jselection system to mark the files that are to be sent. If everything is 8 correct, select "Transfer" to start sending the files. Sending a Disk -------------- O MProTERM has the ability to send an entire 5.25 or 3.5 floppy disk. The disk L Jwill be compressed into its essential data and sent in a "DDD" compatible N Lformat. This means that disks that are sent with ProTERM may be downloaded K Iby users of other communications programs and converted back into a disk O Mthrough the use of a "DDD" compatible program. Any type of disk may be sent P Nincluding DOS 3.3, ProDOS, CP/M, Pascal, or any other unprotected format. If O Mthe remote host is another ProTERM, the data can be spooled back directly to J Hdisk. If the remote host is not a ProTERM, the disk will be saved as a standard file. M KUse the SA-[S] command and select a protocol. Set the "Mode" parameter to I G"Disk" and select the volume to be sent. Make sure that the volume is L Jon-line and ready to go. Disk transfers can take varying amounts of time K Idepending on the amount of data on the disk, its compactability, and the P Nspeed of the transfer. Once the transfer is complete, ProTERM will return to terminal mode. Receiving with a Protocol ------------------------- O MThe protocol that is used for receiving is dependent on the protocol that is N Lbeing used. If it is available, "Ymodem" is the best protocol, followed by P N"Xmodem" and "Transit", and lastly, "Kermit". "Kermit" is normally only used O Mwhen none of the other protocols are available. After selecting the receive + protocol, several parameters must be set. Default File Type -----------------L J The default file type is only used in the "File" and "Batch" modes. F DCertain protocols such as "Xmodem Standard" do not send the special K IProDOS information (including file type). As a result, those files will I Gbe saved with the file type as defined by this parameter. By default, files are saved as text files. Receiving a File ---------------- N LTo receive a file, use the SA-[R] command and select the desired protocol. I GNext, set the "Mode" to "File". Either accept the defaults or set the J Hremaining parameters as defined above. Use the standard file selection M Ksystem to choose a name for the new file. If the file already exists, the N Lduplicate file window will appear. Once the name has been entered, ProTERM I Gwill automatically receive the file. Once the file has been received, ' ProTERM will return to terminal mode. Example: File Receive ----------------------N L The following example contains the exact sequence of events that would G Etake place if you were to receive a file. In this example, the file H F"DATAFILE" will be sent from a bulletin board system running the GBBS I G"Pro" and EXfer software, and be received with ProTERM. While some of I Gthe following is only applicable to GBBS "Pro"/EXfer, it will at least F demonstrate the events as they could potentially happen in real use. F :::::::::::::::::::::::::::::::::::::::::::::::::? EXfer: The Extended Transfer Module3 Version 4.0F ::::::::::::::::::::::::::::::::::::::::::::::::: ; XT: Please enter the type of XMODEM you are using... [1] DOS 3.3 Xmodem [2] ProDOS Xmodem [3] Standard Xmodem [4] No Xmodem, ASCII only XT: Which ? 2 , {You enter "2" to use ProDOS Xmodem.} 001: Public Domain Files + # Filename Typ I Size ( 002 ACOS.PARKER BIN Y 3) 003 ACOS.PARKER.SRC TXT Y 24) 004 ALU BIN N 16) 005 ALU.DOC TXT N 23) 006 DATAFILE TXT N 12 [::] ->Send: DATAFILE N L {You enter "S" at the prompt to send, then enter the filename followed by [RETURN].} XT: [#5]: DATAFILE > XT: Estimated time of transfer is 0 minutes, 53 seconds XT: Sending 47 blocks... N L {EXfer is now sending the file. You must press SA-[R] to tell ProTERM K Ito receive. You would then select the "Xmodem ProDOS" method since that I Gis the mode that EXfer was told to use. Leave the send mode in "File" H Fsince only a single file is being sent. Just press [RETURN] and skip G Eover the "Max Retries" and "Default File Type" fields. Use the file J Hselection system and enter the name of the file as you would like it to K Ibe saved. While "DATAFILE" can be used as a name, any other name can be J Hused just as well. After the filename is specified, ProTERM will begin to receive the file.} Recapping these steps: 1) Press SA-[R]% 2) Select "Xmodem ProDOS"+ 3) Set "Receive Mode" to "File"* 4) Leave "Max Retries" at "10"1 5) Leave "Default File Type" at "TXT"( 6) Enter "DATAFILE" filename Receive Batch ------------- P NTo receive a batch of files, use the SA-[R] command. Select the protocol and O Mset the "Mode" parameter to "Batch". ProTERM will request that you select a O Mpathname onto which the files will be saved. Use the standard "Log" command M Kto set the desired pathname. Enter [ESC] once the pathname is set. Since O Mthe filenames are sent from the remote host, it is possible for the names to O Mbe the same as existing names. In order to get around this problem, ProTERM P Ncan automatically rename the incoming files by appending a dot (.) to the end M Kof the name. Once you decide whether to rename or overwrite, ProTERM will G automatically receive all the files and then return to terminal mode. Receive Binary II ----------------- L JTo receive a batch of files encoded in Binary II (BNY), select the SA-[R] P Ncommand. Select the desired protocol and set the "Mode" parameter to "Binary I GII". As with Receive Batch, use the standard "Log" command to set the D Bpathname. Decide whether to rename or overwrite and ProTERM will & automatically begin receiving files. Receive a Disk -------------- O MTo receive a disk, first select the SA-[R] command to receive. Next, select K Ithe desired protocol. The "Mode" parameter must then be set to "Disk". O Select the location (slot/drive) of the volume where the data is to be saved. O M NOTE: All data on the disk in the selected drive will be erased! Once H the parameters have been set, there will be several chances to cancel. M KIf the procedure is not canceled, ProTERM will format the disk and receive L Jand write the incoming data to the disk, creating a duplicate of the disk I Gthat was sent. If the file being sent was not compressed with a "DDD" K Icompatible program, ProTERM will cancel the transfer early with an error L Jmessage. After the transfer is complete, ProTERM will return to terminal mode. IX. Macros ----------- N LMacros are one of the best features of any program. They allow the user to K Isave time by combining several commands and executing them together. In O Mcommunications, macros generally refer to a set of control instructions that M Kare used to automatically log on to a remote system and/or perform certain L Joperations on that system. While there are many types of macros and many P Ndefinitions, ProTERM has four specific macro types: AUTOLEARN Macros, String L JMacros, Programmable Macros, and Procedure Macros. The first three types N Lwill be discussed in this chapter. Procedure macros are the subject of the next chapter. M KUnder ProTERM, each phone number in the "Dial" window has its own set of 8 L Jmacros. Each macro can be up to 64 characters long. From terminal mode, J these macros can be executed by pressing the SA-[1] through SA-[8] keys. AUTOLEARN Macros ---------------- C AAUTOLEARN is a special ProTERM function that creates macros that J Hautomatically log you on to a remote system without entering user ID's, J Hpasswords, etc. The basic concept behind AUTOLEARN is simple: ProTERM N Lwatches a standard logon sequence with a remote system, then remembers what P Nwas typed. ProTERM analyzes the logon session and makes note of the text you M Kenter in response to prompts from the remote system. Then, ProTERM builds P Nand saves that logon macro for future use. What's more, the macro is created ; using standard macro commands that can be modified later. Creating AUTOLEARN Macros -------------------------N L To create an AUTOLEARN Macro, go into the "Dial" window and select the K Isystem for which the macro is to be created. Once the system parameters F Dappear, select "Edit" and tab down to the "Logon Macro" field. Set K I"Logon Macro" to "AUTOLEARN". Once this field is set, the next time the H Fsystem is called, a macro will be created. Dial and connect with the H Fsystem. When the connection has been made, the message "Learn Macros J HOn:" will appear at the bottom of the screen. If this message does not - appear, AUTOLEARN was not properly enabled. M K At this point simply log onto the system as normal. For best results D Btype slowly. If text is entered too quickly, certain systems may H Fconfuse ProTERM with their delayed echo. Once the logon procedure is I Gcomplete, hold down the open-apple key until the message "Please Wait" E Cappears. At that time the macro will be created and saved to disk K Iautomatically in the PT.MACRO file. You may now use the system you have J Hcalled. The next time you call this system, ProTERM will automatically log on for you. String Macros ------------- M KThe simplest form of macros are "String Macros". These are macros where a F Dsingle key-press represents a string of characters. This string of L Jcharacters can be a name, or phrase, or some other frequently used text. N LString Macros are actually the same as Programmable Macros except that only = one command is used with them, and they are not as complex. Creating String Macros ----------------------N L To create a string macro, select the SA-[M] command to enter the Macro K IEditor. Since each system has its own macro set, a specific system must G Ebe selected to edit. Use the arrow keys to highlight the system and I Gpress [RETURN]. Once the system has been selected, the list of macros F Dwill be displayed. While there are many macro commands that can be J Hused, only the "Print" command is used with string macros. The "Print" G Ecommand takes a string of text and sends it to the remote system; it E Cdoes not send data to the printer. To enter your name as a string A macro, use the [TAB] key to highlight an empty macro and enter: PR /Mike Gola/ H F The "PR" meta-command stands for print. The actual text must be G Esurrounded by a grouping symbol. Along with slash, either single or K Idouble quotes can be used with any other symbol. The only constraint is G Ethat the same symbol be used to begin and end the string. Set "Save H FMacros" to "Yes" and the string macro will be saved. During the next I Gsession with this system, if the SA-[1] command is pressed, the string K I"Mike Gola" will be sent to the remote system. Each macro may contain a different string. Programmable Macros ------------------- N LProgrammable macros are those macros that are written by the user using the O Mmacro command language. The only difference between programmable macros and P Nstring macros is in their complexity. String Macros only send a string using O Mthe "PR" macro command. Programmable Macros generally use several different J Hmacro commands linked together. Besides designing macros from scratch, L existing macros, such as those created by AUTOLEARN, can also be modified. # Creating Programmable Macros# ----------------------------N L To create a programmable macro, select the SA-[M] command to enter the D Bmacro editor. Since each macro set is directly associated with a H Fsystem, you must use the arrow keys to select the system macro set to G Eedit. Any of the eight macro lines can be programmed to do specific functions. L J Multiple macro lines may also be linked together via use of the "GO" J Hcommand. When they appear outside of delimiters, spaces are ignored by H FProTERM and may be used to help make macros readable. Macro commands J Hmay be in either upper or lower case. For those commands which require J Hdelimiters, any symbol character, i.e., { / \ ! $ % & * ( ) ' " ? < > } may be used. P N Control characters must be prefixed by the "^" character when being used I Gin macros. A carriage return is handled as "^M". The carat character J H"^" is represented by "^^". The forward slash character is represented B @by "^/". This is generally found in learn macros where the "/" D Bcharacter is reserved as a delimiter character. In the following : examples, "/" is always used as the delimiter character. E As you enter text, the following editing commands may be used: * Press Means To Get* ----- ----- ------> [CTRL]-[B] [BEGIN] Move to beginning of line.G [CTRL]-[D] [DELETE] Delete the character at the cursor.A [CTRL]-[F] [INSERT] Insert a space at the cursor.< [CTRL]-[N] [END] Move to the end of line.H [CTRL]-[R] [RESTORE] Restore line to original content (ifI [RETURN] has not been pressed yet).6 [CTRL]-[X] [CANCEL] Erase entire line.< [CTRL]-[Y] [TRUNC] Truncate line at cursor. N The following is the list of macro commands, along with their meanings: PR /text string/ P N The PR command will print send the string enclosed in the delimiter " characters to the remote system. )P N PR /This is a test^M/ {sends "This is a test", followed by # )!a carriage return, to the remote )system} 7 WT [time-out,] [string1] [,string2] [,etc]M K The WT command will wait for either a specific period of time, a ) string from the remote system, or both. 7 WT 5 {wait 5 seconds}D WT /HELLO/ {wait for the string "HELLO"}F WT 5,/HELLO/ {wait for 5 seconds or "HELLO"}%K I WT 5,/HELLO/,/BYE/ {wait for 5 seconds, or "HELLO", or %"BYE"} K IF [time-out,link,] [string1,link] [,string2,link] [,etc,link]P N The IF command allows multiple conditions to be evaluated and acted F Dupon. At least two arguments need to be used with the IF command. F DFollowing each argument is an element link number. The numbers one D Bthrough eight indicate the specific macro to link to. Linking to A ?macro number zero will continue execution on the current macro following the IF command. 3P N IF 5,1,/HELLO/,0,PR /OK/ {if 5 seconds have passed, 3 jump to macro 1. Or if 3 "HELLO" is received, then 3 continue this macro with 3printing "OK".} M K IF /HELLO/,1,/BYE/,2 {if "HELLO" is received 3 then jump to macro 1. Or 3 if "BYE" is received then 3jump to macro 2.} M K IF 10,0/HELLO/,4,/BYE/,7,PR /OK/ {if neither "HELLO" nor 3 "BYE" are received within 3 10 seconds, then continue 3 the macro by printing 3 "OK". Or if "HELLO" is 3 received, link to macro 4. 3 Or if "BYE" is received, 3link to macro 7.} ' SY /single sync character/ M K The SY command will send a single character to the remote system > / PR /123^M/ WT /-->/ PR /HELLO^M/ J H Under unmodified GBBS "Pro" systems, the standard prompts for user H Fnumber and password are "-->". This macro waits for the first prompt I Gand sends the user number, "123". It then waits for the second prompt " and sends the password, "HELLO". Unix Systems ------------ 1 PR /^M/ IF 3,1,/gin:/,22 2 PR /user id^m/ WT /word:/ PR /password^M/ K I Many Unix systems require that the user press return to wake up the C Asystem. This macro starts by sending a carriage return. If the K I"Login:" message is not received within three seconds, another return is H Fsent. Once the "Login:" prompt is detected, the user id and password are sent. Macro Command Summary --------------------- 0 PR {string} Print the following string1 ^character This is a Control character> WT # Wait for the following number of secondsA WT |string| Wait for the remote system to send a stringB SY (character) Send a synchronizing character to the remote@ GO # Continue on the macro line specified (1-8)< (Use 0 to continue on the same line)J IF /test/,# Evaluate a test and GO to the following line if trueF (Continue the macro on the same line if false) X. Procedure Macros -------------------- L JProTERM uses two different types of macros. The first kind are "keyboard" K Imacros which are created by the AUTOLEARN feature or via the @-[M] macro M Keditor. Keyboard macros are useful for printing text to remote systems and O Mexecuting logon procedures; however, they cannot instruct ProTERM to do such - things as dial phone numbers or copy files. P Procedure files, on the other hand, are designed to let you have control over P the program. Procedure macros replace the keystrokes you would normally have P to type to access a menu function. It is easy to think of procedure macro as M a tiny little program that can accomplish tasks such as a dialing bulletin L boards, uploading and downloading files, and much more. In fact, you can N access any of ProTERM's menu functions from a procedure file except for the 3 @-[E] editor and the @-[M] keyboard macro editor. M Procedure macros have certain advantages over keyboard macros; conversely, P keyboard macros have certain advantages over procedure macros. For example, a G procedure macro can access ProTERM menu items but cannot effectively H communicate with remote systems. Keyboards macros, on the other hand, L specialize in communicating with remote systems but cannot access ProTERM P menu commands. Because of this, procedure macros must sometimes work hand in 8 hand with keyboard macros to accomplish certain tasks. L The best and easiest way to learn procedure macros is by experience and a O "hands-on" approach. With that in mind, you may wish to have ProTERM up and @ running and be near your computer to try the various examples. CREATING A PROCEDURE MACRO M Unlike keyboard macros, procedure macros are written in the ProTERM Editor N and saved to disk as a ProDOS text file. To execute a procedure macro, you O first press [F] at the main menu (or @-[F] if you are on-line) and then type M the file name of the procedure macro you wish to run. The procedure macro J will then take control of ProTERM and will execute until it is finished. L In order to demonstrate how procedure macros work, let's create one. The L first thing you'll want to do is to go to the main menu and clear out any L data that is in the editor by typing an @-[K]. Next, enter the editor by pressing @-[E] and type: {My First Procedure} L This is a remark, or a comment. Remarks do not affect the execution of a P procedure; rather, they are a way of "documenting" your procedure so that you H know what it is supposed to do. Comments can be placed anywhere in a O procedure macro but must be surrounded by the brace characters ("{" and "}"). " After you've entered this, type: > #D {dial the Arizona Apple Tree} M To save this to disk, type [ESC] to exit the editor and then press [W] (to M "Write Copy Buffer"). Save the macro under the filename "MY.MACRO." When M ProTERM is finished saving this macro, type [F] (to "Execute a Procedure") N and then enter "MY.MACRO" as the filename. ProTERM will then automatically N call the system you specified (in the above example, the Arizona Apple Tree BBS). O When this particular macro is executed it will look for and call a system in N your dialing list named "AzApple Tree" (if you don't call the Arizona Apple J Tree BBS, you can substitute the name of a local system that is in your I dialing list). Let's look at the key elements in this sample procedure: #D P The first element of the macro, #D, is the command. Note the pound character P ("#") that preceeds the "D." The "#" indicates to ProTERM that this key is a / menu function, in this case, "Dial a System." L The second element of the macro, , is a list selection. In N this case, ProTERM will be looking at the list of computer systems that you O normally dial. In this example, the procedure macro would look for a system & with the words "AzApple Tree" in it. K The final element of the macro, , is the option selection. Once a F system is selected, ProTERM opens up another window labeled "System P Parameters." At the bottom of this window you have four different options to N choose from: Dial (dial the system once), Continuous (dial the system until P connected), Edit (edit the system parameters), and Delete (delete this system O from the dialing list). Since you want to dial the system, you must include . the appropriate selection in your procedure. J In their most basic forms, procedure macros will use all three of these ( elements to accomplish a desired task. - HANDLING LISTS FROM WITHIN PROCEDURE MACROS P ProTERM's user interface is based on a list selection system; that is, almost P every item you need to select is in some type of a list. Because of this, it K is important to understand how you can choose listed items from within a + procedure macro before going any further. P In order to choose from a list you should first be familiar with the contents N of the list. Some lists are easy to see; for example, the contents of your H dialing list is usually fully displayed on your screen. Other lists, M however, are not so easy to see. For example, when entering a system into N your dialing list, one of the items you must specify is its baud rate. You N do so by from a list of seven baud rates: 110, 300, 1200, 2400, 4800, 9600, L 19200, pressing the right or left arrow key until the proper baud rate is displayed. L Within procedure files, you select from lists by placing the desired item O between a lass than ("<") and greater than (">") sign. Suppose, for example, 8 that your dialing list contains the following systems: Apple Computer, Inc. The Apple Tree BBS The Cottontail Ranch BBS ProTech Software's BBS P To select any one of these systems, you simply place its name between the "<" and ">" signs: ? { chooses Apple Computer, Inc.}C { chooses the Cottontail Ranch BBS} J ProTERM also allows you to place a partial match within the "<" and ">" P signs; "partial" meaning an incomplete string of characters. If you do this, N the first match encountered will be selected. With this in mind, you could O then select the Cottontail Ranch BBS by placing the word "Ranch" between the 1 "<" and ">" signs instead of the complete name: C { chooses the Cottontail Ranch BBS} M Keep in mind that ProTERM selects the first match; therefore, you couldn't O select "The Apple Tree BBS" with the word "Apple" because ProTERM would find 4 and select the entry "Apple Computer, Inc." first. P ProTERM will also allow you to search for a literal string; that is, an exact P match to a group of characters. To use a literal search, place an apostrophe P character ("!") before the closing ">" sign, making sure that you include all ' the characters you are searching for: G {would choose a system named "Protech"} P The above example would look for a system called "ProTech" and select it. It P would not select "ProTech Software's BBS," since "ProTech Software's BBS" and N "ProTech" do not match literally. Note that since there is no match to the J above search, the macro wouldn't select anything but continue execution. N This procedure for choosing from lists works the same throughout the entire M program, except for once instance. When you are selecting files, you must ? include the complete name between the "<" and ">" characters. . ACCESSING MENU COMMANDS FROM PROCEDURE FILES K To select a menu command from within a procedure file, you enter a pound M character ("#") followed by the letter of the menu item you wish to choose: A #D {open the "Dial a system" window}B #R {open the "Receive a File" window}? #S {open the "Send a File" window} K Note that ProTERM will only look at the first letter following the pound $ symbol and will ignore any others. VARIABLES O One of the most important features of any computer language is the variable. F A variable is usually some symbol that can have more than one value. P ProTERM's procedure macros support nine "user definable" variables (variables O which can be changed by the user). Each variable can have a value from 0 to 99. O In procedure macros, variables are indicated by a dollar sign ("$") followed K by the number of the variable (1-9). The nine variables you can use are: % $1 $2 $3 $4 $5 $6 $7 $8 $9 M To assign a value to one of these variables, you will usually use the *SET command: : *set $1=3 {Set the value of $1 to 3} O The *SET command works the same for each variable and is useful for clearing 0 out or "initializing" the value of a variable: 7 *set $5=0 {Clear out variable $5}> *set $8=50 {Change the value of $8 to 50} H ProTERM also allows you to perform simple addition and subtraction of M variables by using the *SET command in conjunction with the plus ("+") and minus ("-") symbols. : *set $5+ {Add 1 to the value of $5}A *set $7- {Subtract 1 from the value of $7} M Please note that ProTERM only allows you to add or subtract a value of 1. O Also, keep in mind that the value of a procedure variable can only be from 0 N to 99. ProTERM will not perform addition on a variable whose value is 99 or - subtraction on a variable whose value is 0. " BRANCHING OUT IN PROCEDURE FILES O One of the most important aspects of any computer language is the ability to I move around randomly within a program. This is also true of ProTERM's O procedure macros. You will find that it is also necessary to take different I actions from within a procedure macro in order to respond to different P situations. Whenever you alter the normal execution flow of a macro, you are said to be "branching." M In order to branch to a specific group of code, you must first assign that L code a label. A label is much like a house address because it doesn't do N anything other than indicate where something is. For example, your mailman O knows where to deliver a letter to you because of your home address; ProTERM > knows where a certain group of code is because of its label. K In ProTERM, a label is a word (up to 8 characters) preceded by a percent sign: ? %begin {this is an example of a label} O To branch to a certain label, use the ampersand symbol ("&") followed by the M name of the label you are branching to. An example of how a loop works is shown below: 1 %loop {this is a label}; #D {dial the AzApple Tree BBS}5 &loop {go back up to %loop} P The above procedure would repeatedly dial the AzApple Tree BBS. Note that no M checks are made to see if a connection has been established. As a result, O this macro would continue trying to dial the AzApple Tree BBS even if it was N already on-line. While it is not the best example of a procedure macro, it 8 is provided to demonstrate how branching is performed. CONDITIONALS L Earlier in this section of themanual we discussed the nine variables that N ProTERM uses. Remember that these are user definable, meaning that you can M assign values to them. In addition to these, ProTERM has 4 "status" flags that you can read. N For now, the important one we are concerned with is the "$O" flag. This is N the same as the user definable variables except that you cannot assign it a P value. ProTERM will automatically assigns $O a value of 1 if you are on-line N with a remote computer; if you are off-line, ProTERM will assign $O a value of 0. O ProTERM allows you to check any of these variables by using "conditionals". L In ProTERM, a conditional will contain a "true or false" test followed by L code that should be executed if the condition is true. Conditionals will generally use the *IF command: %loop@ *if $O=1 [&stop] {if we are on-line, go to %stop}; #D {dial the AzApple Tree BBS}5 &loop {go back up to %loop} %stopG *end {ProTERM command that ends a procedure} J This is a procedure that will dial the AzApple Tree BBS until it gets a J connection. When a connection is established, the macro will terminate M execution. The macro knows when to stop because of the conditional in the . second line. Let's take a close look at it: @ *if $O=1 [&stop] {if we are on-line, go to %stop} STATUS FLAGS N Status flags are like variables except that you cannot assign them values. O They are used to monitor certain functions within ProTERM. The four ProTERM status flags are: $C $O $F $T O The $C flag is used to see if there is data in the copy buffer. If $C has a P value of 1, then there is data present in the editor. If $C has the value of 0, then the editor is empty. %checkF *if $C=0 [&empty] {if the editor is blank, go to %empty}7 #K {clear the copy buffer} P The $O flag is used to see if you are currently online with a remote system. N If $O returns a value of 1, then you are on-line. If $O returns a value of ; 0, then ProTERM is off-line and usually at the main menu. %statusD *if $O=0 [&stop] {if we are not on-line, go to %stop} K The $F flag is used in conjunction with ProTERM's "*CHECK" command. The N *CHECK command is used to search for a file on disk. If the file is found, P the value of $F will be set to 1. If the file is not present, the value will be set to 0. %fileA *check {look for a file named "startup"}G *if $F=1 [&gotfile] {if the file was found, go to %gotfile} H Finally, $T is used to verify the status of the last transfer ProTERM L completed. If the value of $T is 1, then the last transfer was completed I successfully. If the value of $T is 0, then the last transfer was not > completed successfully and the file should be retransferred. %xferJ *if $T=1 [&gotfile] {if the last xfer was good, goto %gotfile} PROCEDURE COMMAND SET *IF N The *IF command is used to check the value of a variable or a flag. If the K check is positive (true), ProTERM will execute the next batch of code it N finds between the open bracket ("[") and close bracket ("]") characters. If J the check is negative (false), ProTERM will skip the bracketed code and ) continue normal execution of the macro. %loop@ *if $O=1 [&stop] {if we are on-line, go to %stop}; #D {dial the AzApple Tree BBS}= &loop {keep dialing 'til connected}0 %stop {we are on-line}G *end {ProTERM command that ends a procedure} *IFNOT P The *IFNOT command is identical to the *IF command, except that the result of N the test is returned using reverse logoc. Therefore, the test would return 0 TRUE if it was false and FALSE if it was true. %loop@ *ifnot $O=0 [&stop] {if we are on-line, go to %stop}; #D {dial the AzApple Tree BBS}< &loop {keep trying 'til connected}0 %stop {we are on-line}G *end {ProTERM command that ends a procedure} *IFTIME J The *IFTIME command is used to check the clock. Its format is slightly different than *IF and *IFNOT: %waitnoon? *iftime !12:00 [&dial] {if it's 12:00 PM, go to %dial}= &waitnoon {keep looping until 12:00 PM} %dial; #D {dial the AzApple Tree BBS} N Note the format of the time that *IFTIME is to wait for. The time that you O are evaluating must be in military (twenty-four hour) format and preceded by ' an exclamation point character ("!"). P ProTERM will allow you to use the question mark character ("?") as a wildcard # in the time you wish to evaluate: L *iftime !12:1? [&dial] {go to %dial any time between 12:10 & 12:20}> *iftime !??:00 [&dial] {go to %dial on the next hour}H *iftime !??:?? [&dial] {go to %dial no matter what the time is} *NEWTIME I The *NEWTIME command is used in conjunction with the *IFTIME command. L *NEWTIME stops the procedure for one minute. This is designed to be used ? when you don't need or want to repeat the function too often. %onthehour9 *iftime !??:00 [&dial] {go to %dial on the hour}: *newtime {wait here for one minute}F {without this, there would be several}D {dialings while still "on-the-hour"}D &onthehour {it is now 01 minutes past the hour} disk, only the last disk will be saved. Send Disk Volume ----------------L J The "Send Disk Volume" may be set to allow one of the drives on your H Fsystem to be used as a source for sending a disk. If you do not wish I Gcallers to be able to receive a disk, set this parameter to "(none)". B Otherwise select the slot/drive location of the disk to be sent. K IOnce all of the parameters have been set, ProTERM will either wait for a K remote call, or go directly into unattended if a user is already on-line. Getting into Unattended ----------------------- J HOnce your modem and the remote modem are connected, ProTERM will try to N Lfigure out what baud rate they are set at. With certain cables, it will be J Hnecessary for the remote caller to press [RETURN] several times so that < ProTERM can determine the speed at which they are sending. L JAfter the speed has been determined, ProTERM will send the identification M K"ProTERM Remote". If you entered a password in the unattended parameters, I GProTERM will send the request "Pwd:". The remote user will have three P Nchances to enter the password you specified, followed by a [RETURN]. If this H Fpassword is entered correctly, then ProTERM will display the optional K "Welcome" file, and then allow the remote user to start issuing commands. Unattended Commands ------------------- M KProTERM has several commands that may be issued by remote users. Commands J Hcan be entered by simply pressing the first letter corresponding to the P Ncommand. The remote user may press control-S at any time to pause output and N Lanother key to restart it. During long operations, such as "Directory" and L J"View File", a control-C will cancel the operation. The following is the I Glist of legal unattended commands. Typing the letter in "quotes" will execute the command: "?" ---8 The question mark will give the list of commands. ! S = Send, R = Receive& L = Log, D = Dir, C = Chat! V = View, H = Hang up "H"ang Up ---------P N The hang up command will cause ProTERM to disconnect the remote user and " return to wait for another call. "C"hat ------I G When the remote user presses the chat command, the bell will ring D Blocally several times. To chat with a remote user, press the "C" I Gcommand. After you press the "C" command, you can type back and forth ; with the remote user. Press control-C to exit chat mode. "L"og Prefix ------------N L The log command will allow the remote user to set the current prefix. I GInitially, the accessible paths will be displayed. The user will then J Henter his/her choice, and it will be checked for legality. If the path 5 is legal, the new prefix will be set and displayed. "D"irectory -----------J H The directory command will display all of the files on the current H Fprefix. The directory can be aborted early by pressing the control-C "V"iew ------P N View will allow any text file in the current directory to be displayed. ' Press control-C to abort the viewing. Unattended File Transfer ------------------------ M KPerhaps one of the most difficult concepts to grasp when first starting to P Nuse modem communications is that the caller is in charge of both systems. In M Korder to transfer a file (in either direction) the caller must first order O Mthe answering system to either send or receive, then instruct his own system O Mto do the opposite. For example, your friend has a file that you want; your P Nfriend could put his system into unattended remote while you call him. After M Kconnection and password, you would need to enter the Send command to order H Fhis system to be the sender. After establishing the filename and the P Ntransfer protocol, you would tell your system to receive the file. Specifics " on sending and receiving follow. Send Procedures --------------- "S"end ------O M The send command will allow either single or multiple batch files, or a A ?disk to be sent. After send is selected, the protocol must be I Gspecified. All of ProTERM's protocols are supported in remote. After G Especifying the protocols and mode, the filename or names may then be J Hentered, separated by spaces. If an entire disk is sent, no slot/drive G Ewill be requested. Instead the "Send Disk Volume" parameter will be used. J H The following example session is shown as if it were being seen by G Esomeone calling with ProTERM into a remote system running ProTERM in K Iunattended mode. The caller will use the send command to get some files J Hfrom the ProTERM host running in unattended mode. Remember, the caller J His controlling both systems. Comments are shown enclosed by braces - { 2 }. Comments are not part of any screen display. ProTERM Remote Pwd: ..... Q O {The caller must type in a pre-set password to get into unattended. ? =Periods are echoed back so that the password is not actually displayed.} Cmd:D M K {The caller uses the "D" command to get a directory of the files that are available.} Directory Path = /FILES/ ) LETTER.RON TXT 24) LETTER.JERRY TXT 13) LETTER.KEITH TXT 21) LETTER.MARK TXT 13) LETTER.MIKE TXT 17 Free = 185 blocks Cmd:S O M {The caller uses the "S" command to tell the remote system to send some of the files.} Send ' P)roDOS Xmodem, D)os Xmodem) X)modem Standard, C)RC Xmodem& Y)modem, K)ermit, T)ransit Select Protocol: Y ? {The caller enters "Y" so that Ymodem can be used.} - F)ile, B)atch, 2)Binary II, D)isk Send Mode: B D {A "B" is entered so that a batch of files may be sent.} 3 Enter the name of files to be sent, one. per line, leaving last name blank: *>LETTER.RON *>LETTER.JERRY *> F {Two filenames are entered followed by an extra [RETURN].} % ProTERM: Ready to Send... I G {The remote system that is in ProTERM unattended mode is now sending the files.} L J {The caller must now press SA-[R] for his system to receive the F Dfiles. He must next select "Ymodem" since that is the mode that is D Bbeing used in the send. Since multiple files are being sent, the F D"Recv Mode" is set to "Batch". Both the "Max Retries" and "Default D BFile Type" fields are left alone. The file selection system must B @be used to set a destination directory for the files. Once the F Dproper directory is set, the word "