SCRIPT LANGUAGE - Minisoft

Transcription

SCRIPT LANGUAGEWindows (WS92, version 5.4)Creating a ScriptExecuting Script FilesPassing Parameters to ScriptsCommand ReferenceCommandsDDE CommandsFunctionsWS92 Script FileMPE/iX Command FileCOBOL Program

CHAPTER 9: SCRIPT LANGUAGEMS92 features a powerful script language that you can use to createscripts, which are files that contain a sequence of commands. Scripts(also called macros) are an excellent way to automate many repetitiveand time consuming tasks.For example, you can make a script that automatically dials up a computer through a modem, transmits a logon, waits for a password prompt,and submits a password. This simple script would save you time andeffort in connecting to a host computer.Scripts are contained in script files that can be run by MS92, just as otherexecutable files are run on the PC or host.CREATINGASCRIPTYou can create a script by automatically recording it or by manuallybuilding it: WS92 can automatically record a script by “capturing” or “storing”the keystrokes you use to perform a sequence of commands. Thekeystrokes are recorded and stored in a script file. You can create a script in WS92 by manually building a script file.Since script files are text files, you can create a script file with atext editor or a word processor.These two methods of making scripts are discussed in the next twosections.MINISOFT 929-3

CHAPTER 9: SCRIPT LANGUAGEAUTOMATICALLYRECORDING A SCRIPTNote: This function is available only in WS92, not in DOS92.To record a script:1. From the File menu, select Record Script. The Save As dialog boxappears:2. Enter a name for the script you are about to record (make sure theextension is .S92), and click OK.3. Perform the steps you would like to automate using only the keyboard. Mouse movements and clicks are not recorded in a script file.For example, if your script involves one of the commands on thePrint menu, you must go to the menu by pressing ALT-P, not byclicking on it with the mouse.As you perform each function, WS92 makes a record of the keys youpress in the order in which you press them. This record becomes thescript file.4. When you reach the end of recording. Press ALT-F to display theFile menu. Note that there is a checkmark beside Record Script,indicating that your keystrokes are being recorded. Press T (notALT-T) to stop recording the script.9-4MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEEvery keyboard action you have taken since clicking OK in step 2 isrecorded in your new script.See Executing script files later in this chapter, for directions on how torun the scripts you record.MANUALLYBUILDING A SCRIPTFor script examples please refer to the following headings included inthis chapter:CommandsDDE CommandsFunctionsWS92 Script FileMPE/iX Command FileCOBOL ProgramYou may also view script files from our website at www.minisoft.com.From the top menu items, select Manuals. Under Terminal Emulation,select Minisoft-92 Script Manual. A PDF file will then be shown. Fromthe pdf file, copy and paste selected script examples from the website.The sample scripts show you how to create your own scripts in text files.If you use a word processor to write your scripts, remember to save thefiles in ASCII form.Script files should always have the file extension .S92.MINISOFT 929-5

CHAPTER 9: SCRIPT LANGUAGEEXECUTING SCRIPT FILESYou can execute an MS92 script file in several ways: automatically, when you run MS92. via host commands, which are used to initiate script files. manually from within MS92.In scripts executed on the PC: all keywords must be in UPPERCASE. the keyword END must be the last line of the script.AUTOMATIC EXECUTIONUse the parameter (scriptname) to run a script file.For WS92 running under Windows 3.1, append the (scriptname) parameter at the Command Line in the Program Item Properties dialog box inWindows Program Manager when you install MS92. Once MS92 isinstalled, you may change program item properties by selecting theMS92 icon (single clicking to highlight the icon rather than doubleclicking to run it) and then selecting Properties from the File menu ofProgram Manager.For WS92 running under Windows 95, append the (scriptname) parameter on the Open line in the Run box.For example, to run a script called DIALUP.S92, enter the following:C:\WS92\WS92.EXE DIALUP.S92If the script file itself takes parameters, add the parameters after thename of the script file. For example:C:\WS92\WS92.EXE DIALUP.S92 PARM1 PARM29-6MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEThe script file name and its parameters must come at the end of thecommand line. For example, you should place the name of the configuration file before the name of the script file:C:\WS92\WS92.EXE MINISOFT.W92 DIALUP.S92EXECUTIONVIAHOST COMMANDSMS92 interprets the escape sequence [ESC] &oC [cmd]follows:[CR] as If cmd is a script language command, MS92 will execute thatcommand. For example: If cmd is not a script language command, MS92 will look for ascript file with that name and run it. The PC replies S for Success, Ffor Failure. The PC’s reply is implemented as a type 3 block transfer, meaning that it will normally require a DC1 before responding.[ ESC] & oCTELL YOU ARE NOW CONNECTED [CR]MANUAL EXECUTIONSelect Run a script from the file menu in MS92 and enter the name of ascript file or use the scroll box to select one.SCRIPT RUNNINGINWS92The Configure Menu Bars window is shown in the section on Button barand status bar configuration in WS92, which begins in Chapter 2. Thelast item under Status Bar is Script Running. If you have selected thisoption before running a script, an S appears in the lower left corner ofthe WS92 screen whenever a script is running.MINISOFT 929-7

CHAPTER 9: SCRIPT LANGUAGESTOP SCRIPTINWS92The user can select the Stop Script command from the File menu inWS92 at any time the script allows input from the user.9-8MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEPASSING PARAMETERSTOSCRIPTSYou can make your script files more versatile by using run-time parameters. These work in a similar way to DOS batch file parameters. Forexample, suppose you wrote a script file called SENDIT.S92. To havethe script transmit the same file each time, write the following script:LOCF MYFILE.FILHOSTF MYFILERECSIZE 256BINARYUPLOADTo transmit a different file each time, write the following script:LOCF %1HOSTF %2RECSIZE 256BINARYUPLOADYou could then tell the script file to upload NEW.FIL on the PC toNEWFIL on the host by using the following command:MS92 SENDIT.S92 NEW.FIL NEWFILMS92 will replace the entry %1 in the script with the first parameter(NEW.FIL), and the entry %2 with the second parameter (NEWFIL).To write a host escape sequence to do the above, do the following:[ESC] &oCSENDIT.S92 NEW.FIL NEWFIL [CR].MINISOFT 929-9

CHAPTER 9: SCRIPT LANGUAGECOMMAND REFERENCEThe following information contains command references that detail theproper syntax and use of all WS92 script commands and functions.Functions and commands are listed separately, in alphabetical order.TREATMENTOF SPACESWhere parameters are delimited by parentheses, quotation marks, orseparated by commas in a series, execution of the command languagewill ignore spaces in a command. Hence, the following are equivalent:MID ("ABC", 2, 3) and l conventions are used throughout this command referenceto indicate proper command syntax. These conventions are as follows:UPPERCASEUppercase characters indicate a keyword.For example, in this command, HOSTF is the keyword:HOSTF fnamelowercase italicsCharacters in lowercase italics indicate a generic term for a particular item. When you issue the command, substitute the particular itemfor the generic term.For example, in this command, fname is a generic term for afilename. When you issue the command, supply a particularfilename, including its path if necessary:HOSTF fname9-10MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGE()Parentheses delimit a parameter, where indicated.For example, in this command, the string specified must be enclosedin parentheses:LENGTH (string)[]Braces indicate that the parameter is optional.For example, in this command, specifying off is optional:LOG [OFF]{}Brackets indicate the parameter is required.For example, in the following command, you must specify INPUT,OUTPUT, APPEND, or DELETE as a parameter (while specifyingASCII or BINARY is optional):OPEN fname {INPUT OUTPUT APPEND DELETE}AS n [ASCII BINARY] Vertical bar indicates a choice between two or more mutuallyexclusive options.For example, in this command, if you use the ASCII BINARYparameter, you must specify either ASCII or BINARY, not both:RECEIVE LOCF FROM HOSTF [ASCII BINARY];Any line that starts with a semicolon is a comment line, and isignored when the script or program that contains it is run. Commentlines are very beneficial as a way to add notes and explanationsimmediately adjacent to the lines of code to which the commentsapply.&The operator for string concatenation. See the DATE function foran example. The control character, which stands for the CTRL key. The controlcharacter combines with another character to form a control code.MINISOFT 929-11

CHAPTER 9: SCRIPT LANGUAGE [The escape code.To display a in a string as a non control character, use a doublecaret ( ) to neutralize it as a control character. See the followingexample:DISPLAY "This is a "END9-12MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGECOMMANDSACCEPTThe ACCEPT command reads keyboard input from the user and places itin a variable. ACCEPT will read input until the user types a carriagereturn, unless a time limit or character other than carriage return isspecified to end the command.SYNTAXACCEPT [time] variable1 [UNTIL {string FULL}] [LIMIT n][TERMINATOR variable2] [NOECHO]timeAmount of time to wait for user input before canceling ACCEPTcommand. Format is HH:MM:SS. This parameter is optional.variable1The name of a variable where the user's input is to be stored. Thevariable will store up to 1000 characters.UNTIL stringA character to use, instead of carriage return, to end the ACCEPTcommand. Specifying more than one character does not define atermination string for the command. Rather, each of the charactersacts as a terminator. This parameter is optional. ACCEPT willterminate at a carriage return ( M) by default.UNTIL FULLTerminates the ACCEPT command when the user's input equals thevalue of LIMIT (below), or 1000 characters, if no LIMIT is specified. This parameter is optional.LIMIT nThe number of characters to be read, if fewer than 1000. Thisparameter is optional.MINISOFT 929-13

CHAPTER 9: SCRIPT LANGUAGETERMINATOR variable2The name of a variable to store the character that terminates theACCEPT command. If time is exceeded, the contents of this variablewill be 0.NOECHOUser's input is not displayed, asterisk are displayed instead (commonly used when user is entering passwords).EXAMPLELET HEADER "User Name"LET PROMPT "Please enter Your User Logon( user . acct , group ): "ACCEPT USERIDLET HEADER "Password"LET PROMPT "Please enter your Password: "ACCEPT PASSWORD NOECHOKBSPEC HP RETRNKEYWAITS " Q"TRANSMIT "hello " & USERID & " M"WAITS " Q"SEND PASSWORDIn the above example the first accept has a dialog box with the headingof 'User Name' and a prompt of 'Please enter Your User Logon( user . acct , group):'. The value entered will be stored in the variable USERID.The second accept has the heading of 'Password' and the prompt of'Please enter your Password. The value entered will have asterisksdisplayed for each character because of the NOECHO parameter.RELATED FUNCTIONSHEADERPROMPT9-14MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEAPPENDThe APPEND command is used with UPLOAD and DOWNLOADcommands to request data be appended to the end of an existing *****************; Purge the file WS92READ from the END PURGE WS92READ.PUB.MINISOFTWAITC 17;******************************************; Set the ms92.msg file to *LOCF C:\MINISOFT\WS92\MS92.MSGHOSTF WS92READ.PUB.MINISOFTASCIIRECSIZE 90UPLOADWAITC 17;******************************************; Set the latest readme.txt file to be; uploaded, this file will be appended to the; **************APPENDLOCF C:\MINISOFT\WS92\README.TXTUPLOADENDIn the above example, the file on the HP e3000 is purged and a file fromthe PC is uploaded creating the file with a record size of 90 bytes ASCIIformat. When the upload is completed a decimal 17 DC1 trigger issent by the HP e3000. The second upload starts and appends the secondPC file to the file on the HP e3000.MINISOFT 929-15

CHAPTER 9: SCRIPT LANGUAGENote: The RECSIZE, ASCII, or HOSTF commands do not need to berepeated for the second upload.RELATED RECEIVESSAVINF9-16MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEASCIIThe ASCII command sets the mode of the next file transfer to ASCII (ortext) mode. In this mode, a carriage-return/linefeed is used as a separatorbetween *******************; Purge the file WS92READ from the SEND PURGE WS92READ.PUB.MINISOFTWAITC 17;******************************************; Set the ms92.msg file to LOCF C:\MINISOFT\WS92\MS92.MSGHOSTF WS92READ.PUB.MINISOFTASCIIRECSIZE 90UPLOADWAITC 17;******************************************; Set the latest readme.txt file to be; up loaded, this file will be appended to the; ***************APPENDLOCF C:\MINISOFT\WS92\README.TXTUPLOADENDIn the above example, the file on the HP e3000 is purged and the filefrom the PC is uploaded creating the file with a record size of 90 bytesASCII format. When the upload is complete, a decimal 17 DC1 trigger is sent by the HP e3000. The second upload starts and appendsthe second PC file to the file on the HP e3000.MINISOFT 929-17

CHAPTER 9: SCRIPT LANGUAGENote: The RECSIZE, ASCII, or HOSTF commands need to be repeatedfor the second upload.RELATED RECEIVESSAVINF9-18MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEASKThe ASK command presents a message to the user in a message field,and waits for the user to press Y for yes or N for no.SYNTAXASK stringString is the text of the message. Not necessary to delimited by quotationmarks.EXAMPLECLOSE-CONNECTIONNCONNECT JAVELINIF ONLINE 0ASK JAVELIN is not responding, OK to Try SUPPORT?IFYES TRYSUPPENDIFGOTO ENDSLABEL TRYSUPPNCONNECT "SUPPORT"IF ONLINE 0TELL Both Javelin and Support are not responding call MIS forhelpEXITENDIFLABEL ENDSENDIn the above example, if Javelin is not responding, the ASK commandwill display a dialog box with Yes or No buttons. If the YES button isselected the associated command IFYES will redirect the script to thelabel TRYSUPP. If the No button is selected, it will go to the next scriptcommand.RELATED COMMANDSTELL, IFYES, LABEL, :MINISOFT 929-19

CHAPTER 9: SCRIPT LANGUAGEBACKGROUNDSYNTAXBACKGROUNDCauses WS92's Window to ****************; Minimize the Window to the task bar ***************; Perform a host function such as LISTF ,2 *SEND LISTF ,2WAITC **;After the LISTF has finished restore the *******FOREGROUNDENDThe above example will minimize the Window and perform a 'LISTF ,2'.When all files are listed, the window will be restored.RELATED COMMANDSFOREGROUND9-20MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEBARSThe BARS command turns ON or OFF the display of the Button Bar.SYNTAXBARS {ON OFF}ON displays the Button BarOFF hides the Button ******************; Display a dialog box to check to see if the button; Bars should be shown. If yes go to the label TURNON,; if not turn off the *************ASK Do you want to show the Button Bars?IFYES TURNONBARS OFFGOTO ENDSLABEL TURNONBARS ONLABEL ENDSENDThe above example will display a dialog box asking if you wish to showthe Button Bar. Depending on your answer, it will turn on or off theButton Bars.MINISOFT 929-21

CHAPTER 9: SCRIPT LANGUAGEBAUDThe BAUD command sets the Baud of the Comm Port.SYNTAXBAUD {300 1200 2400 4800 9600 **************************************; Set the connection to Off ******************************OCONNECTLABEL *****************************; Prompt for type of connection. Only two allowed, NSVT or ********************************LET PROMPT "Please enter the type of Connection M(Serial, orNSVT)ACCEPT CONNTYPEIF UPPER(CONNTYPE) "NSVT"LET CONNT "N"GOTO NSVTELSEIF UPPER(CONNTYPE) "SERIAL"LET CONNT "S"GOTO SERIALELSETELL "Connection type must be: 'Serial', or 'NSVT'"GOTO ***************************************; If the connection is NSVT then prompt for the Node name or ***********************************LABEL NSVTLET HEADER "ENTER HOST CONNECTION FOR NSVT"LET PROMPT "Please enter the HP3000 IP or Node Name"9-22MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEACCEPT *********************************; Connect using NSVT to the requested ******************************NCONNECT NODENAMEGOTO *******************************; If the connection is serial prompt for the comm port to *****************************LABEL SERIALLET HEADER "SERIAL/MODEM CONNECTION"LET PROMPT "Please Enter Comm Port Number (1-4) "ACCEPT COMMIF (COMM "1") OR (COMM "2") OR (COMM "3") OR(COMM "4")LET COMMPORT COMMELSETELL "Comm port must be 1, 2, 3, or 4"GOTO SERIALENDIF;LABEL ********************************; Now that we know what comm port prompt for the Baud ******************************LET PROMPT "Please Enter the Baud rate M 2400, 4800,9600, or 19200"ACCEPT BAUDIF (BAUD "2400") OR (BAUD "4800") OR (BAUD "9600")OR (BAUD "19200")LET BAUDR BAUDELSETELL "BAUD rate must be 2400, 4800, 9600, or 19200"GOTO *************************************; Connect to the comm port and set the baud rate if ********************************CCONNECT COMMPORTBAUD BAUDRLABEL *******************************; Save the new setting to the Default.w92 configuration file.MINISOFT 929-23

CHAPTER 9: SCRIPT *********************************SAVE DEFAULT.W92ENDLABEL ENDSENDThe above example can be used to set up the connection for theDefault.W92 file. The user is prompted for the type of connection LANvia NSVT or Serial. If serial is selected then they are prompted forComm Port to be use, and at what Baud Rate.RELATED COMMANDSCCONNECT9-24MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEBEEPThe BEEP command sounds the PC *******************************;DISPLAY The command to stop the script when a 1 is entered;or if more than ten **************DISPLAY Enter 1 to stop the beepLET XX 1:RETRYBEEPWAIT 00:00:01 FOR "1"IF FOUNDGOTO ENDSENDIFLET XX XX 1IF XX 10GOTO ENDSENDIFGOTO RETRY:ENDSSEND HENDIn the above example, the user's PC will make a noise (beeping sound)until a 1 is entered or after the noise has been repeated 10 times.MINISOFT 929-25

CHAPTER 9: SCRIPT LANGUAGEBINARYThe BINARY command sets the mode of the next file transfer to *******************; Purge the file DEFAULT from the SEND PURGE DEFAULT.PUB.MINISOFTWAITC 17;******************************************; Set the DEFAULT.W92 configuration as the file to LOCF C:\MINISOFT\WS92\DEFAULT.W92HOSTF DEFAULT.PUB.MINISOFTBINARYRECSIZE 256UPLOADWAITC 17ENDThe above example will store the DEFAULT.W92 configuration file tothe HP e3000 as a binary file. This can then be sent to a different PC.Contents of the file need to be in a BINARY format.RELATED IZERECEIVESSAVINFMINISOFT 92

CHAPTER 9: SCRIPT LANGUAGEBLOCK CURSORThe BLOCK CURSOR command allows a script to change the cursorshape to either underline or block.SYNTAXBLOCK CURSOR {ON OFF}ON for Block Cursor, OFF for Underline CursorEXAMPLELABEL CURSORLET HEADER "CURSOR SETTING"LET PROMPT "(B) Block or (U) UnderlineCursor MRecommend B "ACCEPT CURSIF UPPER(CURS) "B"LET CURBLK "ON"ELSEIF UPPER(CURS) "U"LET CURBLK "OFF"ELSETELL "Answer must be 'B' or 'U'"GOTO CURSORENDIFBLOCK CURSOR CURBLKENDIFENDIn the above example, the user is prompted as to the cursor setting, 'B'for Block and 'U' for Underline. If anything else is entered an errormessage is generated and the user is asked to re-enter. Once the answeris entered correctly, the Block Cursor command is set to on or off.MINISOFT 929-27

CHAPTER 9: SCRIPT LANGUAGEBREAKThe BREAK command sends a break signal to the host computer. Thiscommand has the same effect as pressing ALT-B within Minisoft **************************; Start a application in this example it is editor; Text in a file and then do a break followed by an; abort. This is just an example not a recommend way to; exit the ************SEND EDITORWAITC 17SEND T DELTESTWAITC 17BREAKWAITC 17SEND ABORTWAITC 17ENDThe above example sends a break signal, waits for a host prompt, thenaborts the interrupted program.9-28MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGECAPSThe CAPS command allows a script to set CAP LOCK on or off.SYNTAXCAPS {ON OFF}To change all character to uppercase, set CAPS to ON.To have both upper and lower case available set CAPS to ****************; Prompt the user asking if they want Cap Lock; On or Off. When Cap Lock is on all Character typed as; upper case. When off upper and lower case can be *************LABEL CAPLOCKLET HEADER "CAP LOCK SETTING"LET PROMPT "Cap Lock On? (Y/N)"ACCEPT CAPLIF UPPER(CAPL) "Y"LET CAPSET "ON"ELSEIF UPPER(CAPL) "N"LET CAPSET "OFF"ELSETELL "Answer must be 'Y' or 'N'"GOTO CAPLOCKENDIFENDIFCAPS CAPSETENDThe above example will prompt and set the Cap Lock setting.MINISOFT 929-29

CHAPTER 9: SCRIPT LANGUAGECCONNECTThe CCONNECT command sets the Comm Port.SYNTAXCCONNECT {1 2 3 **********************************; Set the connection to Off *************; Prompt for the comm port to *****************************LABEL SERIALLET HEADER "SERIAL/MODEM CONNECTION"LET PROMPT "Please Enter Comm Port Number (1-4) "ACCEPT COMMIF (COMM "1") OR (COMM "2") OR (COMM "3") OR(COMM "4")LET COMMPORT COMMELSETELL "Comm port must be 1, 2, 3, or 4"GOTO SERIALENDIF;LABEL ********************************; Now that we know what comm port prompt for the Baud ******************************LET PROMPT "Please Enter the Baud rate M 2400, 4800,9600, or 19200"ACCEPT BAUDIF (BAUD "2400") OR (BAUD "4800") OR (BAUD "9600")OR (BAUD "19200")LET BAUDR BAUDELSE9-30MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGETELL "BAUD rate must be 2400, 4800, 9600, or 19200"GOTO *************************************; Connect to the comm port and set the baud rate if ********************************CCONNECT COMMPORTBAUD ******************************; Save the new setting in the Default.w92 configuration ******************************SAVE DEFAULT.W92ENDThe above example can be used to set up the comm port Default.W92file. The user is prompted for the Comm Port and Baud. CCONNECTwill then open the connection on that comm port/ .RELATED COMMANDSBAUDMINISOFT 929-31

CHAPTER 9: SCRIPT LANGUAGECENTERThe CENTER command allows a script to center or left justify thedisplay screen.SYNTAXCENTER {ON OFF}ON centers the display screen.OFF left justifies the display screenEXAMPLELABEL CENTERLET HEADER "CENTER DISPLAY"LET PROMPT "Center(C) or Left Justify (L) the MDisplaywithin the Window?"ACCEPT DISPLAYIF UPPER(DISPLAY) "C"LET JUSTIFY "ON"ELSEIF UPPER(DISPLAY) "L"LET JUSTIFY "OFF"ELSETELL "Answer must be 'C' for Center or 'L' for Left Justify"GOTO CENTERENDIFENDIFCENTER JUSTIFYENDThe above example prompts the user, asking if the display should becentered or left justified. Takes the response as C or L and sets thedisplay screen as requested.9-32MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGECHAINThe CHAIN command allows your script to transfer control to anotherscript. The current script ends its execution and is removed frommemory.SYNTAXCHAIN fnameWhere fname is the name of a script file.EXAMPLE;CHAIN1.S92CLOSE-CONNECTIONNCONNECT JAVELINIF ONLINE 0ASK JAVELIN is not responding, OK to Try SUPPORT?IFYES TRYSUPPGOTO ENDSENDIFLABEL TRYSUPPCHAIN CHAIN2.S92LABEL ENDSLET VAR1 "You are connecting to JAVELIN"CHAIN CLOGON.S92END;CHAIN2.S92NCONNECT "SUPPORT"IF ONLINE 0TELL Both Javelin and Support are not responding call MIS forhelpEXITELSELET VAR1 "You are connecting to SUPPORT"CHAIN CLOGON.S92ENDIFEND;CLOGIN.S92MINISOFT 929-33

CHAPTER 9: SCRIPT LANGUAGETELL VAR1LET HEADER "User Name"LET PROMPT "Please enter Your User Log( user . acct , group ): "ACCEPT USERIDLET HEADER "Password"LET PROMPT "Please enter Your Password: "ACCEPT PASSWORD NOECHOKBSPEC HP RETRNKEYWAITS " Q"TRANSMIT "hello " & USERID & " M"WAITS " Q"SEND PASSWORDENDThere are three script files involved in the above example; CHAIN1.S92CHAN2.S92 and CLOGON.S92. Normally scripts stay in memory untilthe WS92 is closed. With the CHAIN command, the script is removefrom memory, however, variables from one script can be used in asecond script.In this example, the first script CHAIN1.S92 tries to connect to anNSVT connection using the node name JAVELIN. If JAVELIN is notresponding, it will ask permission to try the node SUPPORT. If theconnection is made, the third script CLOGON.S92 will use a variable setin one of the prior scripts to let you know which node you are connectingand logging on to.RELATED COMMANDSINVOKEGOSUB9-34MINISOFT 92

CHAPTER 9: SCRIPT LANGUAGECHDIRThe CHDIR command allows your script to change the default directoryon the PC.SYNTAXCHDIR {path name}Where path name is the path to the new directory.EXAMPLECHDIR C:\temp\LOCF DELSFILEHOSTF DELTESTASCIIDOWNLOADWAITC 17CHDIR C:\MINISOFT\WS92\ENDThe above example changes the path to the c:\temp\ directory for the filetransfer, (the file delsfile will be sent to the C:\temp\ directory) then afterthe file transfer it will return to the C:\minisoft\ws92 directory.NOTE: CD can be used in place of CHDIR.MINISOFT 929-35

CHAPTER 9: SCRIPT LANGUAGECLOSEThe CLOSE command closes an open file or device. Files should beclosed after input and output are completed, so as not to attempt to openfiles that may already be opened.SYNTAXTo close a file:CLOSE nn Specifies the file number used to open this file. Must be in therange 1-5.To close a device:CLOSE {DISK PRINTER}DISKCloses the disk currently open as the "to" device.PRINTERCloses the printer currently open as the "to" ***************************; Close files in case they were left open from a prior ********************CLOSE 1CLOSE *************; Close the printer so that the log bottom can be redirected; to disk file, followed by the open for the listfile.txt *************CLOSE PRINTEROPEN ************************; send the HP3000 command to list the file names of the logon; ******************send LISTF,69-36MINISOFT 92

CHAPTER 9: SCRIPT ********************; Wait for the decimal value of 10 which is a Line Feed before; doing the log bottom, this keeps the LISTF,6 from being; included in the list of ******************WAITC 10LOGWAITC **************; Turn off the log bottom and close the disk file .;*******************

CHAPTER 9: SCRIPT LANGUAGE 9-6 MINISOFT 92 EXECUTING SCRIPT FILES You can execute an MS92 script file in several ways: automatically, when you run MS92. via host commands, which are used to initiate script files. manually from within MS92. In scripts executed on the PC: all keywords must be in UPPERCASE. the keyword END must be the last line of the script.