home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / pibsoft / terminal / doc / pt41scri.doc < prev   
Encoding:
Text File  |  1988-02-26  |  278.5 KB  |  5,487 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.             
  8.             
  9.             
  10.             
  11.             
  12.             
  13.             
  14.             
  15.             
  16.             
  17.             
  18.             
  19.             
  20.             
  21.             
  22.             
  23.             
  24.             
  25.             
  26.             
  27.             
  28.             
  29.             
  30.                 +=================================================+
  31.                 +=================================================+
  32.                 |      PibTerm Script Language Reference Guide    |
  33.                 |      PibTerm Script Language Reference Guide    |
  34.                 +=================================================+
  35.                 +=================================================+
  36.                                           
  37.                                           
  38.                                           
  39.                                           
  40.                                           
  41.             
  42.             
  43.             
  44.             
  45.             
  46.             
  47.             
  48.             
  49.             
  50.             
  51.             
  52.             
  53.             
  54.             
  55.             
  56.                   Copyright (c) February, 1988 by Philip R. Burns
  57.                   Copyright (c) February, 1988 by Philip R. Burns
  58.  
  59.  
  60.  
  61.  
  62.  
  63.             
  64.             Using Script Files ....................................    1
  65.             Using Script Files ....................................    1
  66.                 Compatibility With Old Scripts ....................    1
  67.             Executing a Script File ...............................    1
  68.             Executing a Script File ...............................    1
  69.                 From the PibTerm command line .....................    1
  70.                 From <ALT>G .......................................    2
  71.                 User-defined command ..............................    2
  72.                 Compiling Scripts .................................    2
  73.                 Limitations on Script Size ........................    2
  74.                 Script Library PIBTERM.SCL ........................    2
  75.                     Search Order For Scripts ......................    3
  76.                 Terminating Execution Of A Script .................    4
  77.                 Automatic Script Generation -- The Learn Facility .    4
  78.             Script File Commands ..................................    4
  79.             Script File Commands ..................................    4
  80.                 General Syntax of Script Commands .................    9
  81.                 Script Variable Names .............................    9
  82.                     Declaring variables ...........................   10
  83.                     Saving variable values after script ends ......   10
  84.             Detailed Description of Script Commands ...............   11
  85.             Detailed Description of Script Commands ...............   11
  86.                 AddCommand -- Add User-Defined Command ............   11
  87.                 Addlf -- Add Line Feeds ...........................   14
  88.                 Alarm -- Issues Five Beeps ........................   14
  89.                 Break -- Send Break ...............................   14
  90.                 Call -- Call Internal Script Procedure ............   14
  91.                 Capture -- Capture Session To Disk ................   14
  92.                 Case -- Case Selector For DoCase ..................   15
  93.                 ChDir -- Change Current Directory or Drive ........   15
  94.                 Clear -- Clear Screen .............................   15
  95.                 Close -- Close File ...............................   16
  96.                 ClrEol -- Clear Display To End Of Line ............   16
  97.                 ComDrain -- Drain Serial Port Output Buffer .......   16
  98.                 ComFlush -- Flush Serial Port Buffers .............   16
  99.                 CopyFile -- Copy File .............................   17
  100.                 Delay -- Delay Execution For Specified Interval ...   17
  101.                 DelLine -- Delete Current Line On Screen ..........   18
  102.                 Dial --- Dial A Number ............................   18
  103.                 DirFirst -- Find First Matching File ..............   18
  104.                 DirNext -- Find Next Matching File ................   20
  105.                 DoCase -- Do Case Statement .......................   22
  106.                 Dos -- Execute DOS Command ........................   23
  107.                 Echo --- Toggle Local Echo ........................   24
  108.                 EditFile -- Invoke File Editor ....................   24
  109.                 Else -- Part Of IF Statement ......................   24
  110.                 EndCase -- Ends Case Block ........................   25
  111.                 EndDoCase -- Ends DoCase Statement ................   25
  112.                 EndIf --- Ends An IF Statement ....................   25
  113.                 EndProc -- Ends a Script Procedure ................   25
  114.                 EndWhile -- Ends a WHILE block ....................   25
  115.                 EraseFile -- Erase (Delete) A File ................   25
  116.                 Execute -- Execute One Script From Another ........   25
  117.                 Exit -- Terminate Script Execution ................   27
  118.                 ExitAll -- Exit Nested Scripts ....................   27
  119.                 For -- Start FOR Loop .............................   28
  120.                 FreeSpace -- Find Free Space On Drive .............   28
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                 GetDir -- Get Current Directory And Drive .........   29
  127.                 GetParam -- Get Value of PibTerm Parameter ........   29
  128.                 GetVar -- Get Value of Script Variable ............   30
  129.                 GoToXY -- Move To Specified Screen Position .......   31
  130.                 Hangup -- Hang Up The Phone .......................   32
  131.                 Host -- Enter Host Mode ...........................   32
  132.                 If -- Conditionally Execute Statements ............   32
  133.                     Conditions allowed in IF statements ...........   32
  134.                 Import -- Import Variable To Execute Script .......   33
  135.                 Input -- Get Input From Keyboard ..................   34
  136.                 InsLine -- Insert Line At Cursor ..................   35
  137.                 Key -- Set Function Key Values ....................   35
  138.                 KeyDef -- Define Function Key Value ...............   36
  139.                 KeyFlush -- Flush KeyBoard ........................   37
  140.                 KeySend -- Send Function Key Value To Remote ......   37
  141.                 Log -- Toggle Printer Logging .....................   38
  142.                 Menu -- Display Pop-Up Menu .......................   38
  143.                 Message -- Display Message On Screen ..............   39
  144.                 Mute -- Toggle Mute Mode ..........................   39
  145.                 Open -- Open File .................................   39
  146.                 Param -- Set Program Parameter ....................   40
  147.                 PrintFile -- Print A FIle .........................   41
  148.                 Procedure -- Define Script Procedure ..............   41
  149.                 Quit -- Quit PibTerm execution ....................   44
  150.                 Read -- Read Character From A File ................   44
  151.                 Readln -- Read Line From File .....................   45
  152.                 Receive -- Receive File From Remote System ........   46
  153.                 Redial -- Redial Last Number Dialed ...............   48
  154.                 Repeat -- Repeat Block Of Statements ..............   48
  155.                 Reset -- Reset Script Execution To Start Of Script    49
  156.                 RInput -- Receive Input From Remote System ........   49
  157.                 ScreenDump -- Dump Screen To File .................   50
  158.                 Send -- Send File To Remote System ................   50
  159.                 Set -- Assign Value To Script Variable ............   52
  160.                 SetParam -- Set Value Of PibTerm Parameter ........   55
  161.                 SetVar -- Set Value of PibTerm Parameter ..........   56
  162.                 SText -- Send Text To Remote System ...............   57
  163.                 Suspend -- Suspend Execution Of Script ............   57
  164.                 Text -- send text to remote system ................   58
  165.                 Translate -- Read In Translate Table ..............   58
  166.                 Until -- Ends Repeat Block ........................   58
  167.                 ViewFile -- Invoke File Viewer ....................   58
  168.                 Wait -- Wait For Time Of Day ......................   59
  169.                 WaitCount -- Wait For Number Of Characters ........   59
  170.                 WaitList -- Wait For List Of Strings ..............   60
  171.                 WaitQuiet -- Wait For Quiet Line ..................   61
  172.                 WaitString -- Wait For String From Remote .........   61
  173.                 WaitTime -- Set Wait Time .........................   62
  174.                 When -- Wait For String And Respond ...............   62
  175.                 WhenDrop -- Take Action On Carrier Drop ...........   63
  176.                 WhereXY -- Return Current Cursor Position .........   63
  177.                 While -- Execute Statements While Condition True ..   64
  178.                 Write -- Write Characters To File .................   64
  179.                 Writeln -- Write Line To File .....................   65
  180.  
  181.  
  182.  
  183.  
  184.  
  185.                 WriteLog -- Write String To Log Files .............   65
  186.             Using Script Commands in Command Line Mode ............   65
  187.             Using Script Commands in Command Line Mode ............   65
  188.                 Command mode key definition .......................   65
  189.                 Script Commands Legal In Command Line Mode ........   66
  190.             Sample Scripts ........................................   67
  191.             Sample Scripts ........................................   67
  192.                 CDC/NOS login script ..............................   67
  193.                 VAX/VMS login script ..............................   68
  194.                 IBM CMS login script ..............................   69
  195.                 LUIS login script .................................   71
  196.                 OPUS login script .................................   72
  197.                 RBBS login script .................................   73
  198.                 IBBS login script .................................   73
  199.                 CompuServe login script ...........................   74
  200.                 Using A Password File .............................   75
  201.                 PC Board login script using password file .........   78
  202.                 Reading A New Configuration File ..................   80
  203.             Defining Scripts For External Transfer Protocols ......   81
  204.             Defining Scripts For External Transfer Protocols ......   81
  205.                 SENDMLIN.SCR for sending files with MegaLink ......   84
  206.                 RECMLINK.SCR for receiving files with MegaLink ....   86
  207.                 SENDZMOD.SCR for sending files with Zmodem ........   87
  208.                 RECZMOD.SCR for receiving files with Zmodem .......   89
  209.             
  210.  
  211.  
  212.  
  213.  
  214.  
  215.             
  216.             Using Script Files
  217.             Using Script Files
  218.             
  219.             PibTerm provides  an extensive  script file  facility  which
  220.             allows you to create a file containing a set of instructions
  221.             for PibTerm to execute. The instructions can include dialing
  222.             up a  remote system, performing file transfers,  waiting for
  223.             a specific time before initiating an event, and many others.
  224.             Scripts allow  PibTerm to  run in   unattended mode and take
  225.             advantage of  off-hours  rates  on  host  computer  systems.
  226.             Scripts automate such chores as logging into remote systems.
  227.             And,  scripts  provide  you  with  the  tools  you  need  to
  228.             customize PibTerm by adding new commands or replacing built-
  229.             in commands with those of your own devising.
  230.             
  231.             
  232.             Compatibility With Old Scripts
  233.             Compatibility With Old Scripts
  234.             
  235.             The script  language starting with PibTerm v4.0 represents a
  236.             considerable upgrade  of the  script language  available  in
  237.             previous  versions.    Most  of  the  script  commands  have
  238.             changed, mainly  to support  script variables.  When writing
  239.             new scripts  you should  use the  new syntax and facilities.
  240.             However,  scripts  written  using  the  old  pre-version-4.0
  241.             script language  SHOULD continue  to work  with just  a  few
  242.             minor changes.   If an old script does not execute correctly
  243.             with PibTerm  v4.0 (or  a later  version), try rewriting the
  244.             part of  the old  script that  fails using  the  new  script
  245.             syntax.   Most of  the incompatibilities  arise  because  of
  246.             script variables, which are new in PibTerm v4.0, and because
  247.             of minor  changes in  things  like  file  transfer  protocol
  248.             abbreviations.
  249.             
  250.             
  251.             Executing a Script File
  252.             Executing a Script File
  253.             
  254.             There are three ways to execute a script file.  The first is
  255.             to enter  the file  name of  a script  file on  the  PibTerm
  256.             command line itself at the DOS prompt:
  257.             
  258.                  PIBTERM /s=script.SCR
  259.             
  260.             where script.SCR is the name of a script file.  You need not
  261.                   script.SCR                                            
  262.             explicitly give  the .SCR,  it is  understood  if  no  other
  263.                                  .SCR                                   
  264.             extension is provided.
  265.             
  266.             When PibTerm  begins execution,  it will take its input from
  267.             the script file.  You may still type keyboard entries if you
  268.             desire, and  there are some script commands which explicitly
  269.             request keyboard  input.   This  provides  quite  a  bit  of
  270.             flexibility  in   case  something   goes  wrong  during  the
  271.             execution of  a script  and you  are present  to repair  the
  272.             damage.
  273.             
  274.  
  275.  
  276.             PibTerm Script Language Reference Guide              Page 2
  277.             PibTerm Script Language Reference Guide              Page 2
  278.  
  279.  
  280.             If no  script file  name appears  on the PibTerm invocation,
  281.             PibTerm looks  for the  file  PIBTERM.SCR  and  executes  it
  282.                                           PIBTERM.SCR                   
  283.             automatically if  found.   This is  useful if  you  want  to
  284.             execute a  fixed set  of commands  each time  you  start  up
  285.             PibTerm.
  286.             
  287.             The second  way to  execute a  script file is to hit <ALT>G.
  288.             You will  be prompted  for the  name of  the script  file to
  289.             execute.  Again, you need only provide the first part of the
  290.             file name; .SCR is understood.
  291.             
  292.             If you  hit the  Enter key, a directory of available scripts
  293.                              Enter                                      
  294.             appears. You  can choose  to execute one  by using the arrow
  295.             keys to  move to the desired script and hitting the Enter or
  296.                                                                 Enter   
  297.             Return key.
  298.             Return     
  299.             
  300.             The third  way to  execute a  script is  through the  use of
  301.             user-defined commands.   PibTerm  allows you  to  execute  a
  302.             subset of  script commands  using a  command-line mode.  You
  303.             can also  define your  own commands  as  extensions  to  the
  304.             script language;  these are implemented as scripts which are
  305.             automatically invoked  when the  command you defined is used
  306.             in command-line mode.  We will discuss user-defined commands
  307.             in more detail later on.
  308.             
  309.             
  310.             Compiling Scripts
  311.             Compiling Scripts
  312.             
  313.             Before  executing  a  script  file,  PibTerm  scans  it  and
  314.             converts it  to an in-memory list of commands.  This process
  315.             is called  compiling  the  script.  During  the  compilation
  316.                        compiling                                        
  317.             process, you  will be informed if any script command line is
  318.             syntactically bad.  PibTerm stops scanning at the first line
  319.             in error.  Any erroneous  script statement  prevents PibTerm
  320.             from executing the script.
  321.             
  322.             
  323.             Limitations on Script Size
  324.             Limitations on Script Size
  325.             
  326.             The size  of a  script is limited by the available memory to
  327.             hold the  "compiled" script  code. If  there is  not  enough
  328.             memory for  the  script,  it  will  not  be  executed.    No
  329.             individual script can compile to more than 32767 bytes; this
  330.             should not  pose   any problems,  since long  scripts can be
  331.             broken up into a series of shorter scripts which  can invoke
  332.             each other using the EXECUTE script command.
  333.                                  EXECUTE                
  334.             
  335.             
  336.             Script Library PIBTERM.SCL
  337.             Script Library PIBTERM.SCL
  338.             
  339.             The  file  PIBTERM.SCL  provides  a  simple  script  library
  340.                        PIBTERM.SCL                                      
  341.             facility. Versions  of PibTerm  prior to  v4.0 required that
  342.             each script  be stored  in a separate file. This resulted in
  343.             considerable wasted  disk space,  since even  a tiny  script
  344.  
  345.  
  346.             PibTerm Script Language Reference Guide              Page 3
  347.             PibTerm Script Language Reference Guide              Page 3
  348.  
  349.  
  350.             took up  a large  block of disk space.  The file PIBTERM.SCL
  351.             may contain  many scripts;   since  it it is one large file,
  352.             disk space is more efficiently used.
  353.             
  354.             PIBTERM.SCL is  a straightforward  ASCII  text  file.    The
  355.             scripts contained  in it  follow one  right after the other,
  356.             separated by a line beginning (in column one) with two equal
  357.             signs and  the name  of the script.  For example, if we have
  358.             three  scripts,   named  WINKEN,   BLINKEN,  and  NOD,  then
  359.             PIBTERM.SCL would look like this:
  360.             
  361.             
  362.                  ==WINKEN
  363.                       -- text of winken.scr
  364.                  ==BLINKEN
  365.                       -- text of blinken.scr
  366.                  ==NOD
  367.                       -- text of nod.scr
  368.             
  369.                  ^
  370.                  |
  371.                  column 1
  372.             
  373.             Script entries  will be  searched for  sequentially in  this
  374.             file. Thus,  you should place the most commonly used scripts
  375.             at the front of PIBTERM.SCL.
  376.             
  377.             PIBTERM.SCL  must  reside  in  the  main  PibTerm  directory
  378.             (pointed to by SET PIBTERM=).
  379.             
  380.             You may  place the  primary script  file to  be executed  in
  381.             PIBTERM.SCL instead of creating a separate PIBTERM.SCR file.
  382.             For this to work, the following conditions must hold:
  383.             
  384.                  1.   No PIBTERM.SCR exists.
  385.             
  386.                  2.   ==PIBTERM    is  the FIRST LINE (and therefore the
  387.                       first script) in PIBTERM.SCL.
  388.             
  389.             This execution order is taken regardless of any script order
  390.             configuration settings (see next section).
  391.             
  392.             
  393.             Search Order For Scripts
  394.             Search Order For Scripts
  395.             
  396.             The new  parameter SF=  provides the  name of  the directory
  397.             containing the  (separate file)  scripts to be executed.  If
  398.             SF is  the null  string, then the current directory is used.
  399.             SF= can be set from the <ALT>P P)aths menu.
  400.             
  401.             Scripts may executed from separate files or from the library
  402.             file PIBTERM.SCL.   The  new parameter SO= defines the order
  403.             in which a search for a script is performed:
  404.             
  405.  
  406.  
  407.             PibTerm Script Language Reference Guide              Page 4
  408.             PibTerm Script Language Reference Guide              Page 4
  409.  
  410.  
  411.                  SO=0:     SF= directory, then PIBTERM.SCL  (default)
  412.                  SO=1:     PIBTERM.SCL then SF=
  413.                  SO=2:     SF= only  (ignore PIBTERM.SCL)
  414.                  SO=3:     PIBTERM.SCL only  (ignore SF= and any scripts
  415.                            contained there)
  416.             
  417.             
  418.             Terminating Execution Of A Script
  419.             Terminating Execution Of A Script
  420.             
  421.             To stop  executing a  script, use  the <ALT>X command.  If a
  422.             script is  executing, you  will be prompted as to whether or
  423.             not you want to stop executing the script.  If you then want
  424.             to exit PibTerm, type <ALT>X again.
  425.             
  426.             You can  also use  the EXIT  and EXITALL  script commands to
  427.                                    EXIT      EXITALL                    
  428.             terminate a  script from  within a  script, or  from command
  429.             line mode.
  430.             
  431.             
  432.             Automatic Script Generation -- The Learn Facility
  433.             Automatic Script Generation -- The Learn Facility
  434.             
  435.             If you  hit Enter  after striking  <ALT>G, you are presented
  436.             with a  list of  scripts available  for execution as well as
  437.             several other  facilities.   One of  these is  the "Learn  a
  438.             script."   This option  opens a  file to receive a specially
  439.             edited transcript of the communications session in which the
  440.             local and  remote input  and  output  are  transformed  into
  441.             script commands.   This allows PibTerm to "learn" a sequence
  442.             of script commands which you can edit and use again later.
  443.             
  444.             When you start a learn script sequence, you are prompted for
  445.             the maximum  number of  characters to  be generated  in  any
  446.             WAITSTRING and also for the maximum number of lines (defined
  447.             by a  string of  characters ended  with  CR  or  LF)  to  be
  448.             generated in  any WAITSTRING.  Usually choosing the defaults
  449.             of 30 characters and 1 line produces good results.
  450.             
  451.             You usually need to touch up the generated script  manually.
  452.             
  453.             See the  "Guide to  PibTerm" for  more details on learning a
  454.             script.
  455.             
  456.             
  457.             Script File Commands
  458.             Script File Commands
  459.             
  460.             Script file  commands consist  of an  initial  command  word
  461.             possibly followed by zero or more arguments.  Blank lines or
  462.             lines beginning  with an  "*" may be used as comments.  Many
  463.             of the  commands perform  similar functions  to the  regular
  464.             <Alt>letter keyboard entries described in the PibTerm Guide.
  465.             
  466.             Here is  a complete  list of  PibTerm script commands with a
  467.             brief description  of the  purpose  of  each.    A  detailed
  468.             description of each command will be given later.
  469.  
  470.  
  471.             PibTerm Script Language Reference Guide              Page 5
  472.             PibTerm Script Language Reference Guide              Page 5
  473.  
  474.  
  475.             
  476.             AddCommand     adds a user-defined command to PibTerm script
  477.             AddCommand                                                  
  478.                            language
  479.             
  480.             AddLF          adds line feeds to carriage returns.
  481.             AddLF                                              
  482.             
  483.             Alarm          issues five beeps
  484.             Alarm                           
  485.             
  486.             Break          issues a break sequence (like <ALT>B).
  487.             Break                                                
  488.             
  489.             Call           calls internal script procedure
  490.             Call                                          
  491.             
  492.             Capture        toggles session  capture  to  specified  file
  493.             Capture                                                     
  494.                            (like <ALT>O).
  495.             
  496.             Case           selection block header for DOCASE statement
  497.             Case                                                      
  498.             
  499.             ChDir          changes current directory
  500.             ChDir                                   
  501.             
  502.             Clear          clears the screen (like <ALT>C).
  503.             Clear                                          
  504.             
  505.             Close          closes specified file
  506.             Close                               
  507.             
  508.             ClrEol         clears display  from cursor to end of line on
  509.             ClrEol                                                      
  510.                            screen
  511.             
  512.             ComDrain       drains serial port output ring buffer
  513.             ComDrain                                            
  514.             
  515.             ComFlush       flushes ring buffers for serial port
  516.             ComFlush                                           
  517.             
  518.             CopyFile       copies one file to another
  519.             CopyFile                                 
  520.             
  521.             Declare        provides name,  type, and  initial value  for
  522.             Declare                                                     
  523.                            script variable
  524.             
  525.             Delay          delays PibTerm execution for specified length
  526.             Delay                                                       
  527.                            of time.
  528.             
  529.             DelLine        deletes current line in screen display
  530.             DelLine                                              
  531.             
  532.             Dial           dial a  number in the dialing directory (like
  533.             Dial                                                        
  534.                            <ALT>D).
  535.             
  536.             DirFirst       finds  first   file   matching   a   wildcard
  537.             DirFirst                                                    
  538.                            specification
  539.             
  540.             DirNext        finds subsequent  files matching  a  wildcard
  541.             DirNext                                                     
  542.                            specification
  543.             
  544.             DoCase         starts multiway selection statement
  545.             DoCase                                            
  546.             
  547.             Dos            executes a  specified DOS  command  (somewhat
  548.             Dos                                                         
  549.                            like <ALT>J).
  550.             
  551.  
  552.  
  553.             PibTerm Script Language Reference Guide              Page 6
  554.             PibTerm Script Language Reference Guide              Page 6
  555.  
  556.  
  557.             Echo           toggles local echo (like <ALT>E).
  558.             Echo                                            
  559.             
  560.             
  561.             EditFile       invokes the currently defined editor (usually
  562.             EditFile                                                    
  563.                            the built-in PibTerm editor)
  564.             
  565.             Else           FALSE branch of an IF statement.
  566.             Else                                           
  567.             
  568.             EndCase        ends a Case block
  569.             EndCase                         
  570.             
  571.             EndDoCase      ends a DoCase statement
  572.             EndDoCase                             
  573.             
  574.             EndFor         ends FOR loop
  575.             EndFor                      
  576.             
  577.             EndIf          ends an IF statement.
  578.             EndIf                               
  579.             
  580.             EndProc        ends an internal script procedure
  581.             EndProc                                         
  582.             
  583.             EndWhile       ends a WHILE statement.
  584.             EndWhile                              
  585.             
  586.             EraseFile      erases (deletes) a file
  587.             EraseFile                             
  588.             
  589.             Execute        executes another script
  590.             Execute                               
  591.             
  592.             Exit           stop executing the script.
  593.             Exit                                     
  594.             
  595.             ExitAll        exits nested scripts
  596.             ExitAll                            
  597.             
  598.             For            starts For loop
  599.             For                           
  600.             
  601.             FreeSpace      finds free space on drive
  602.             FreeSpace                               
  603.             
  604.             GetDir         gets current drive and directory
  605.             GetDir                                         
  606.             
  607.             GetParam       gets value of a PibTerm parameter
  608.             GetParam                                        
  609.             
  610.             GetVar         gets value of a PibTerm variable
  611.             GetVar                                         
  612.             
  613.             GoToXY         positions   cursor    at   specified   screen
  614.             GoToXY                                                      
  615.                            coordinates
  616.             
  617.             HangUp         hangs up the phone (like <ALT>H).
  618.             HangUp                                          
  619.             
  620.             Host           enters Host mode (like <ALT>W).
  621.             Host                                          
  622.             
  623.             If             test   for   several   different   types   of
  624.             If                                                          
  625.                            conditions; Else  is also available and Endif
  626.                            terminates an IF block.
  627.             
  628.             Import         declares variable  passed  to  nested  script
  629.             Import                                                      
  630.                            invoked using Execute
  631.             
  632.             InsLine        inserts line  at current  cursor position  on
  633.             InsLine                                                     
  634.                            screen
  635.  
  636.  
  637.             PibTerm Script Language Reference Guide              Page 7
  638.             PibTerm Script Language Reference Guide              Page 7
  639.  
  640.  
  641.             
  642.             Input          prompt for input from local user.
  643.             Input                                           
  644.             
  645.             Key            sets function  keys from specified file (like
  646.             Key                                                         
  647.                            <ALT>K "Read definitions from a file").
  648.             
  649.             KeyFlush       flushes current keyboard buffer
  650.             KeyFlush                                      
  651.             
  652.             KeySend        sends specified  function key's definition to
  653.             KeySend                                                     
  654.                            remote system.
  655.             
  656.             Log            toggles  session  logging  on  printer  (like
  657.             Log                                                         
  658.                            <ALT>L).
  659.             
  660.             Menu           displays pop-up menu
  661.             Menu                               
  662.             
  663.             Message        display message  on PC's  screen; message  is
  664.             Message                                                     
  665.                            not sent to remote system.
  666.             
  667.             Mute           toggles mute mode (like <ALT>M).
  668.             Mute                                           
  669.             
  670.             Open           opens a file
  671.             Open                       
  672.             
  673.             Param          sets program parameters
  674.             Param                                 
  675.             
  676.             PrintFile      starts printing  of  a  file  using  built-in
  677.             PrintFile                                                   
  678.                            PibTerm spooling facility
  679.             
  680.             Procedure      defines start of internal script procedure
  681.             Procedure                                                
  682.             
  683.             Read           reads characters from a file
  684.             Read                                       
  685.             
  686.             Readln         reads a line from a file
  687.             Readln                                 
  688.             
  689.             Receive        receives a  file from  a remote  system (like
  690.             Receive                                                     
  691.                            <ALT>R).
  692.             
  693.             Redial         redials the  last phone  number entered (like
  694.             Redial                                                      
  695.                            <ALT>Q).
  696.             
  697.             Repeat         begins block  of statements  to be repeatedly
  698.             Repeat                                                      
  699.                            executed until  condition on  matching  UNTIL
  700.                            statement is true.
  701.             
  702.             Reset          starts executing  script from  the  beginning
  703.             Reset                                                       
  704.                            again.
  705.             
  706.             Return         returns from  internal  script  procedure  to
  707.             Return                                                      
  708.                            calling procedure
  709.             
  710.             RInput         prompt for input from remote system.
  711.             RInput                                             
  712.             
  713.             Send           sends a file to a remote system, like <ALT>S.
  714.             Send                                                        
  715.             
  716.  
  717.  
  718.             PibTerm Script Language Reference Guide              Page 8
  719.             PibTerm Script Language Reference Guide              Page 8
  720.  
  721.  
  722.             Set            sets value of a script variable
  723.             Set                                           
  724.             
  725.             SetParam       sets value of a PibTerm parameter
  726.             SetParam                                        
  727.             
  728.             SetVar         sets value of a script variable
  729.             SetVar                                        
  730.             
  731.             SText          send text  to remote  system,  and  interpret
  732.             SText                                                       
  733.                            embedded   characters   like   function   key
  734.                            characters.
  735.             
  736.             Suspend        suspends  script   execution  for   specified
  737.             Suspend                                                     
  738.                            length of time (PibTerm continues executing).
  739.             
  740.             Text           send   text    to   remote   system   without
  741.             Text                                                        
  742.                            interpretation.
  743.             
  744.             Translate      reads in a translation table (like <ALT>T).
  745.             Translate                                                 
  746.             
  747.             Until          terminates   REPEAT    block   and   provides
  748.             Until                                                       
  749.                            termination condition.
  750.             
  751.             ViewFile       invokes   currently   defined   file   viewer
  752.             ViewFile                                                    
  753.                            (usually built-in PibTerm file viewer)
  754.             
  755.             Wait           stops PibTerm  execution  until  a  specified
  756.             Wait                                                        
  757.                            time (in  HH:MM:SS form) is reached, at which
  758.                            time execution proceeds.
  759.             
  760.             WaitCount      waits for  specified number  of characters to
  761.             WaitCount                                                   
  762.                            appear from remote system
  763.             
  764.             WaitList       waits for  any one  of a  list of  strings to
  765.             WaitList                                                    
  766.                            appear from remote system
  767.             
  768.             WaitQuiet      waits for serial port input to quiesce
  769.             WaitQuiet                                            
  770.             
  771.             WaitString     waits for  a given  string to appear from the
  772.             WaitString                                                  
  773.                            remote system (only done once).
  774.             
  775.             WaitTime       sets wait time for other wait commands
  776.             WaitTime                                             
  777.             
  778.             When           waits for  a given  string to appear from the
  779.             When                                                        
  780.                            remote system,  and then  sends  a  specified
  781.                            response string  (done as  often as  required
  782.                            string appears).
  783.             
  784.             WhenDrop       specifies action to take when carrier drops
  785.             WhenDrop                                                  
  786.             
  787.             WhereXY        returns current cursor position on screen
  788.             WhereXY                                                 
  789.             
  790.             While          begins block  of statements  to be repeatedly
  791.             While                                                       
  792.                            executed as  long as  specified condition  is
  793.                            true.   A While  block is  terminated  by  an
  794.                            EndWhile statement.
  795.  
  796.  
  797.             PibTerm Script Language Reference Guide              Page 9
  798.             PibTerm Script Language Reference Guide              Page 9
  799.  
  800.  
  801.             
  802.             Write          writes characters to a file
  803.             Write                                     
  804.             
  805.             Writeln        writes a line to a file
  806.             Writeln                               
  807.             
  808.             WriteLog       writes text to log/capture files
  809.             WriteLog                                       
  810.             
  811.             
  812.             General Syntax of Script Commands
  813.             General Syntax of Script Commands
  814.             
  815.             Here are some general comments about script command syntax:
  816.             
  817.             1.   Command names  may be  entered in  any case;  "CLEAR" =
  818.                  "Clear" = "ClEaR".
  819.             
  820.             2.   Each command must fit on a single input line.  There is
  821.                  no provision for multi-line commands.
  822.             
  823.             3.   When quoted  strings are  called for,  either single or
  824.                  double quotes  may be  used.   To insert a quote into a
  825.                  string in  which that  same quote  is being used as the
  826.                  string delimiter,  write  two  adjacent  quotes.    For
  827.                  example, the string
  828.             
  829.                       Here's a string
  830.             
  831.                  can be written as:
  832.                  
  833.                       'Here''s a string'.
  834.             
  835.             4.   Quoted strings  cannot span  a line.   Unclosed  quotes
  836.                  cause an error.
  837.             
  838.             
  839.             Script Variable Names
  840.             Script Variable Names
  841.             
  842.             The PibTerm  script language  includes variables  as well as
  843.             commands. Script  variable names may be up to ten characters
  844.             long, and  may contain letters and digits.  Case is ignored.
  845.             The first character must be a letter.
  846.             
  847.             Examples:
  848.             
  849.                  Abc
  850.                  c34
  851.                  ABC  (same as Abc)
  852.                  thelongone
  853.             
  854.             
  855.  
  856.  
  857.             PibTerm Script Language Reference Guide              Page 10
  858.             PibTerm Script Language Reference Guide              Page 10
  859.  
  860.  
  861.             Declaring variables
  862.             Declaring variables
  863.             
  864.             You may  declare script  variables using  the Declare script
  865.                                                           Declare       
  866.             command. ALL  script variables  MUST  appear  in  a  Declare
  867.             command.  Each Declare defines only one variable.
  868.             
  869.             The syntax of a Declare statement is:
  870.             
  871.                  DECLARE name type S3
  872.             
  873.             where name is the variable name,  type is the variable type,
  874.                   name                        type                      
  875.             and S3  is the  initial value  of the  variable.   S3 may be
  876.             either a string variable or a string constant.
  877.             
  878.             Note that  neither the  name nor  the type  is  enclosed  in
  879.             quotes.
  880.             
  881.             Case is not important in variable names.
  882.             
  883.             The following types are available:
  884.             
  885.             INTEGER   An integer  value from  -2147483648 to  2147483647
  886.             INTEGER                                                     
  887.                       (beginning with  PibTerm v4.1  -- in PibTerm v4.0,
  888.                       values were limited to the range -32768 to 32767).
  889.             
  890.             STRING    A variable  length  string  of  maximum  size  255
  891.             STRING                                                      
  892.                       characters.
  893.             
  894.             Examples:
  895.             
  896.                  DECLARE Abc String  'ABC'
  897.             
  898.                       --   a string of maximum length 255 with initial   
  899.                            value ABC
  900.             
  901.                  DECLARE c  Integer
  902.             
  903.                       --   'c' is an integer with initial value 0
  904.             
  905.             When no  initial value  is provided  a  string  variable  is
  906.             assigned the  null string as a value when it is declared.  A
  907.             numeric variables  is set  to zero  if no  initial value  if
  908.             provided.
  909.             
  910.             ABC, Abc,  AbC, etc.  are all  the same variable name.  Case
  911.             doesn't matter in variable names.
  912.             
  913.             
  914.             Saving variable values after script ends
  915.             Saving variable values after script ends
  916.             
  917.             Variables disappear  when the  last script  in  a  stack  of
  918.             nested scripts  is finished executing.  If you want to carry
  919.             over the  variable  values  from  one  script  execution  to
  920.             another, you  can use  the text  file  facilities  to  store
  921.  
  922.  
  923.             PibTerm Script Language Reference Guide              Page 11
  924.             PibTerm Script Language Reference Guide              Page 11
  925.  
  926.  
  927.             information on  MS DOS  files  between  script  invocations.
  928.             Alternatively, you  can store  variable values  in  (unused)
  929.             function  keys  (see  the  KeyDef  script  command  and  the
  930.                                        KeyDef                           
  931.             KeyString function in the Set script command).
  932.             KeyString                 Set                 
  933.             
  934.             Each script  gets it  own set  of variables.  It is possible
  935.             for one  script to invoke another, and for those two scripts
  936.             to share  variables.  This is done using the Import facility
  937.             described later.
  938.             
  939.             
  940.             Detailed Description of Script Commands
  941.             Detailed Description of Script Commands
  942.             
  943.             The following  sections  detail  each  script  command.  The
  944.             examples for some commands use other commands which will not
  945.             be described  until later.   You may need to make two passes
  946.             through these  descriptions in order to fully understand the
  947.             examples.
  948.             
  949.             In what  follows, any  variable name  beginning with  a  'S'
  950.             indicates a  string variable  or constant,  and any variable
  951.             starting with 'I' indicates an integer variable or constant.
  952.             (Note:   It is  assumed that  variables have  been  properly
  953.             declared using the DECLARE statement.)
  954.             
  955.             
  956.             AddCommand -- Add User-Defined Command
  957.             AddCommand -- Add User-Defined Command
  958.             
  959.             PibTerm allows you to define up to one hundred new commands.
  960.             This is  primarily useful  when PibTerm  is  being  used  in
  961.             command key mode.
  962.             
  963.             The script  command AddCommand  adds a  new command.  It has
  964.                                 AddCommand                              
  965.             the syntax:
  966.             
  967.                  AddCommand Sname Script
  968.             
  969.             Sname is  the name  of the command to be added, which may be
  970.             Sname                                                       
  971.             up eight characters long.
  972.             
  973.             Script is  the name  of the  script to  be invoked  when the
  974.             Script                                                      
  975.             command is  encountered either  in a script or (more likely)
  976.             when entered in command key mode.
  977.             
  978.             Both Sname  and Script  may be  either string  variables  or
  979.                  Sname      Script                                      
  980.             string constants.
  981.             
  982.             The best  way to set up a list of commands to be added is to
  983.             place  all   the  AddCommand   definitions  in  the  default
  984.             PIBTERM.SCR which  will be automatically executed at startup
  985.             time.
  986.             
  987.             If you  write a  command with  the same  name as an existing
  988.             PibTerm script  command, then your version will override the
  989.                                                        will override    
  990.  
  991.  
  992.             PibTerm Script Language Reference Guide              Page 12
  993.             PibTerm Script Language Reference Guide              Page 12
  994.  
  995.  
  996.             built-in command.  You may still want access to the built-in
  997.             command -- for example, if you're writing a spiffy front-end
  998.             for a  built-in command.   To  request the  original command
  999.             name, precede it by a '$'.
  1000.                                   '$'.
  1001.             
  1002.             For example,  suppose you  write a  new RECEIVE command, but
  1003.                                                     RECEIVE             
  1004.             you still want access to the original RECEIVE.  Then you can
  1005.                                                   RECEIVE               
  1006.             write $RECEIVE  where you  want the  reference to  be to the
  1007.                   $RECEIVE                                              
  1008.             original built-in RECEIVE command.
  1009.                               RECEIVE         
  1010.             
  1011.             To illustrate how to add a command, suppose that you want to
  1012.             define an EMULATE command for PibTerm. Also suppose that the
  1013.             script containing the code to perform the EMULATE command is
  1014.             in the script file EMULATE.SCR.  Then you could write:
  1015.                                EMULATE.SCR                        
  1016.             
  1017.                  AddCommand 'Emulate' 'Emulate.scr'
  1018.             
  1019.             Now if you enter a command like:
  1020.             
  1021.                  Emulate VT100
  1022.             
  1023.             then control  is passed  to 'Emulate.scr'  to  process  that
  1024.             input line.  When the  script gains control, all of the text
  1025.             following the  command name  'Emulate' itself is stored as a
  1026.             parameter line.   The contents of that parameter line can be
  1027.             accessed using  the ParamLine  command,  or  pieces  may  be
  1028.             broken  out   using  the   ParamCount  and  ParamStr  string
  1029.             functions.     ParamCount  and  ParamStr  operate  like  the
  1030.             standard Turbo  Pascal functions  of the  same name,  except
  1031.             that they  operate on the command line text, not the PibTerm
  1032.             parameter text:   ParamCount  counts the  number of  (blank-
  1033.             delimited) command line entries, and ParamStr(i) returns the
  1034.             ith command-line entry.
  1035.             
  1036.             To make  this  clearer,  here  is  the  text  for  a  sample
  1037.             EMULATE.SCR script:
  1038.             
  1039.                  *******************************************************************
  1040.                  *                                                                 *
  1041.                  *  Emulate.scr --- Command processor to set terminal emulation.   *
  1042.                  *                  Use ADDCOMMAND 'Emulate' 'Emulate.scr' to      *
  1043.                  *                  activate this function.                        *
  1044.                  *                                                                 *
  1045.                  *  Use:                                                           *
  1046.                  *                                                                 *
  1047.                  *    Emulate terminalname                                         *
  1048.                  *                                                                 *
  1049.                  *       terminalname -- name of terminal (e.g., VT100) to         *
  1050.                  *                       emulate.                                  *
  1051.                  *                                                                 *
  1052.                  *******************************************************************
  1053.                  *
  1054.                  Declare TermName String
  1055.                  *
  1056.  
  1057.  
  1058.             PibTerm Script Language Reference Guide              Page 13
  1059.             PibTerm Script Language Reference Guide              Page 13
  1060.  
  1061.  
  1062.                  *   Pick up terminal name from command line text.
  1063.                  *
  1064.                  IF ( ParamCount > 0 ) THEN
  1065.                     Set TermName = UpperCase( ParamStr( 1 ) )
  1066.                  ELSE
  1067.                     Set TermName = ' '
  1068.                  ENDIF
  1069.                  *
  1070.                  *   Set terminal type depending upon name.
  1071.                  *
  1072.                  DOCASE TermName OF
  1073.                     CASE 'DUMB'
  1074.                        Message "Dumb terminal chosen."
  1075.                        SetParam   'te' '0'
  1076.                     ENDCASE
  1077.                     CASE 'VT52'
  1078.                        Message "VT52 terminal chosen."
  1079.                        SetParam   'te' '1'
  1080.                     ENDCASE
  1081.                     CASE 'ANSI'
  1082.                        Message "ANSI/BBS terminal chosen."
  1083.                        SetParam   'te' '2'
  1084.                     ENDCASE
  1085.                     CASE 'VT100'
  1086.                        Message "VT100 terminal chosen."
  1087.                        SetParam   'te' '3'
  1088.                     ENDCASE
  1089.                     CASE 'GOSSIP'
  1090.                        Message "Gossip mode chosen."
  1091.                        SetParam   'te' '4'
  1092.                     ENDCASE
  1093.                     CASE 'TEK4010'
  1094.                        Message "Tek 4010 terminal chosen."
  1095.                        SetParam   'te' '6'
  1096.                     ENDCASE
  1097.                     CASE 'ADM3A'
  1098.                        Message "ADM3a terminal chosen."
  1099.                        SetParam   'te' '7'
  1100.                     ENDCASE
  1101.                     CASE 'ADM5'
  1102.                        Message "ADM5 terminal chosen."
  1103.                        SetParam   'te' '8'
  1104.                     ENDCASE
  1105.                     CASE 'TV925'
  1106.                        Message "Televideo 925 terminal chosen."
  1107.                        SetParam   'te' '10'
  1108.                     ENDCASE
  1109.                     CASE ELSE
  1110.                        Message "Bogus terminal choice!"
  1111.                     ENDCASE
  1112.                  ENDDOCASE
  1113.             
  1114.             
  1115.  
  1116.  
  1117.             PibTerm Script Language Reference Guide              Page 14
  1118.             PibTerm Script Language Reference Guide              Page 14
  1119.  
  1120.  
  1121.             AddLF -- Add Line Feeds
  1122.             AddLF -- Add Line Feeds
  1123.             
  1124.             AddLF toggles  the addition  of a line feed to each carriage
  1125.             AddLF                                                       
  1126.             return received from the remote system.  This is useful when
  1127.             accessing remote  systems that  expect a  carriage return to
  1128.             also act  as a  line feed.  Not many system do that anymore.
  1129.             However, occasionally  a  system  accessed  using  FTP  over
  1130.             ArpaNet doesn't  send the  <CR><LF> sequence,  just <CR>, so
  1131.             AddLF is a handy way to rectify that problem.
  1132.             
  1133.             
  1134.             Alarm -- Issues Five Beeps
  1135.             Alarm -- Issues Five Beeps
  1136.             
  1137.             Alarm issues five beeps as long as mute mode is turned off.
  1138.             Alarm                                                      
  1139.             
  1140.             
  1141.             Break -- Send Break
  1142.             Break -- Send Break
  1143.             
  1144.             Break issues  a break  signal over  the communications port.
  1145.             Break                                                       
  1146.             This is  exactly the same as hitting the <ALT>B.  The length
  1147.             of the break signal is controlled by the BL= parameter.
  1148.             
  1149.             
  1150.             Call -- Call Internal Script Procedure
  1151.             Call -- Call Internal Script Procedure
  1152.             
  1153.             Call  invokes   an  internal  script  procedure.    See  the
  1154.             Call                                                        
  1155.             Procedure command below for more details.
  1156.             Procedure                                
  1157.             
  1158.             
  1159.             Capture -- Capture Session To Disk
  1160.             Capture -- Capture Session To Disk
  1161.             
  1162.             Capture toggles  session capture  to a  specified file.  The
  1163.             Capture                                                     
  1164.             syntax of the capture command is:
  1165.             
  1166.                  Capture Sname Scaptype
  1167.             
  1168.             Sname is the name of the file to capture to.
  1169.             Sname                                       
  1170.             
  1171.             Scaptype indicates  the type  of capture  to  be  performed.
  1172.             Scaptype                                                    
  1173.             "E" specifies   an  edited  capture  and  "U"  specifies  an
  1174.             unedited capture.  An edited  capture displays  the lines as
  1175.             they appear  on the  screen.   An  unedited  capture  writes
  1176.             characters as they arrive from the remote system.
  1177.             
  1178.             For example,  to initiate  edited session  capture  to  file
  1179.             "GETIT.DAT", use the script command:
  1180.             
  1181.                  Capture "GETIT.DAT" "E"
  1182.             
  1183.             If the  script variable  'Sname' contains  "GETIT.DAT",  you
  1184.             could also write:
  1185.             
  1186.                  Capture Sname "E"
  1187.             
  1188.  
  1189.  
  1190.             PibTerm Script Language Reference Guide              Page 15
  1191.             PibTerm Script Language Reference Guide              Page 15
  1192.  
  1193.  
  1194.             To turn  off capture  later in  the same  script, just enter
  1195.             Capture with no argument:
  1196.             
  1197.                  Capture
  1198.             
  1199.             Be careful  -- if  you enter  Capture with no arguments, and
  1200.             you have  not previously  requested session  capturing, then
  1201.             PibTerm will  issue a  prompt for  the capture file name, if
  1202.             PibTerm is  running in  attended mode. The intent here is to
  1203.             provide flexibility  when running a script in attended mode;
  1204.             but if you're not careful, you may find an unattended script
  1205.             gets hung  up waiting  for the  capture file name entry.  In
  1206.             unattended mode, the spurious Capture is ignored.
  1207.             
  1208.             
  1209.             Case -- Case Selector For DoCase
  1210.             Case -- Case Selector For DoCase
  1211.             
  1212.             Case marks  the start  of a  Case/EndCase block  in a DoCase
  1213.             Case                                                        
  1214.             statement.   See the DoCase statement definition for further
  1215.                                  DoCase                                 
  1216.             details.
  1217.             
  1218.             
  1219.             ChDir -- Change Current Directory or Drive
  1220.             ChDir -- Change Current Directory or Drive
  1221.             
  1222.             ChDir changes  the current  logged directory  and/or  drive.
  1223.             ChDir                                                       
  1224.             The syntax is:
  1225.             
  1226.                  CHDIR   Sdir
  1227.             
  1228.             Sdir is  either a string variable or constant containing the
  1229.             Sdir                                                        
  1230.             name of the new directory, drive, or both in standard MS DOS
  1231.             directory format.
  1232.             
  1233.             Examples:
  1234.             
  1235.                  ChDir 'c:\modem'
  1236.                  Set mydir = 'b:\bogus'
  1237.                  ChDir mydir
  1238.             
  1239.                  ChDir 'b:'
  1240.                  Set mydrive = 'b:'
  1241.                  ChDir mydrive
  1242.             
  1243.             
  1244.             Clear -- Clear Screen
  1245.             Clear -- Clear Screen
  1246.             
  1247.             Clear clears  the screen (except for the status line).  This
  1248.             Clear                                                       
  1249.             is just like the <ALT>C keyboard command.
  1250.             
  1251.             
  1252.  
  1253.  
  1254.             PibTerm Script Language Reference Guide              Page 16
  1255.             PibTerm Script Language Reference Guide              Page 16
  1256.  
  1257.  
  1258.             Close -- Close File
  1259.             Close -- Close File
  1260.             
  1261.             Close closes  a file  opened using  the script  command Open
  1262.             Close                                                   Open
  1263.             (see below).  The syntax is:
  1264.             
  1265.                CLOSE  Ifile
  1266.             
  1267.             IFile is the index of the file to be closed.
  1268.             IFile                                       
  1269.             
  1270.                  *
  1271.                  Declare MyFile Integer
  1272.                  *
  1273.                  Close 1
  1274.                  Set Myfile = 3
  1275.                  Close Myfile
  1276.             
  1277.             
  1278.             ClrEol -- Clear Display To End Of Line
  1279.             ClrEol -- Clear Display To End Of Line
  1280.             
  1281.             ClrEol clears  the display beginning with the current cursor
  1282.             ClrEol                                                      
  1283.             position and  continuing to  the end  of  the  line  on  the
  1284.             screen.
  1285.             
  1286.             
  1287.             ComDrain -- Drain Serial Port Output Buffer
  1288.             ComDrain -- Drain Serial Port Output Buffer
  1289.             
  1290.             ComDrain waits  a specified number of seconds for the serial
  1291.             ComDrain                                                    
  1292.             port output buffer to empty.  The syntax is:
  1293.             
  1294.                  ComDrain IWaitSecs
  1295.             
  1296.             where "IWaitSecs"  is the  number of seconds to wait for the
  1297.                    IWaitSecs                                            
  1298.             buffer to  become empty.   Execution of the script continues
  1299.             with the next statement when either the buffer is drained or
  1300.             the number of seconds to wait is exceeded.
  1301.             
  1302.             
  1303.             ComFlush -- Flush Serial Port Buffers
  1304.             ComFlush -- Flush Serial Port Buffers
  1305.             
  1306.             ComFlush flushes  or drains  the serial  port  buffers.  The
  1307.             syntax is:
  1308.             
  1309.                  ComFlush Sflushtyp
  1310.             
  1311.             where "Sflushtyp"  is a  string constant  or variable  which
  1312.                    Sflushtyp                                            
  1313.             indicates which serial port buffers are to be flushed:
  1314.             
  1315.                  'I'       Flush input buffer only
  1316.                  'O'       Flush output buffer only
  1317.                  'B'       Flush both buffers
  1318.             
  1319.             If no  Sflushtyp appears,  both the input and output buffers
  1320.                    Sflushtyp                                            
  1321.             are flushed.
  1322.             
  1323.  
  1324.  
  1325.             PibTerm Script Language Reference Guide              Page 17
  1326.             PibTerm Script Language Reference Guide              Page 17
  1327.  
  1328.  
  1329.             The input  buffer is  flushed by  throwing away  the current
  1330.             contents of  the buffer -- i.e., any character received from
  1331.             the remote  system but  not yet  processed by PibTerm -- and
  1332.             then waiting for the port to become briefly inactive.
  1333.             
  1334.             The output  buffer is  flushed by throwing away the contents
  1335.             of the  buffer, i.e.,  any characters  waiting to be sent to
  1336.             the remote system.
  1337.             
  1338.             
  1339.             CopyFile --- Copy File
  1340.             CopyFile --- Copy File
  1341.             
  1342.             CopyFile copies one file (of any type) to another.  The copy
  1343.             CopyFile                                                    
  1344.             proceeds byte-by-byte and is not limited to text files.  The
  1345.             syntax is:
  1346.             
  1347.                  COPYFILE  Sorig Scopy
  1348.             
  1349.             Sorig is the original file to be copied.
  1350.             Sorig                                   
  1351.             Scopy is the resultant copy.
  1352.             Scopy                       
  1353.             
  1354.             
  1355.             Delay -- Delay Execute for Specified Interval
  1356.             Delay -- Delay Execute for Specified Interval
  1357.             
  1358.             Delay delays PibTerm execution for the number of tenths of a
  1359.             Delay                                                       
  1360.             second specified by the argument.  The syntax is:
  1361.             
  1362.                  Delay Idelay
  1363.             
  1364.             For example,
  1365.             
  1366.                  Delay  10
  1367.             
  1368.             delays PibTerm  execution for one second (ten tenths = one).
  1369.             To delay execution for half a second, enter:
  1370.             
  1371.                  Delay 5
  1372.             
  1373.             If the  script variable  Delaytime contains  a 5,  then  you
  1374.             could write:
  1375.             
  1376.                  Declare DelayTime Integer
  1377.                  Set DelayTime = 5
  1378.                  Delay Delaytime
  1379.             
  1380.             to delay execution for half a second.
  1381.             
  1382.             Delay differs from the Suspend command described below.  The
  1383.             Delay                  Suspend                              
  1384.             Suspend  command   only  halts  SCRIPT  processing  for  the
  1385.             specified  length   of  time.     Delay  halts  ALL  PibTerm
  1386.             processing (except  the asynchronous  reception of  incoming
  1387.             characters).
  1388.             
  1389.             
  1390.  
  1391.  
  1392.             PibTerm Script Language Reference Guide              Page 18
  1393.             PibTerm Script Language Reference Guide              Page 18
  1394.  
  1395.  
  1396.             DelLine -- Delete Current Line On Screen
  1397.             DelLine -- Delete Current Line On Screen
  1398.             
  1399.             DelLine deletes  the display line on which the cursor rests.
  1400.             DelLine                                                     
  1401.             All lines  below the  deleted line  (except the status line)
  1402.             are scrolled up.
  1403.             
  1404.             
  1405.             Dial -- Dial A Number
  1406.             Dial -- Dial A Number
  1407.             
  1408.             Dial dials  a number  in the PibTerm dialing directory, just
  1409.             Dial                                                        
  1410.             like <ALT>D.  The number  to be dialed can be specified as a
  1411.             string variable or string constant. The syntax for Dial is:
  1412.             
  1413.                  DIAL    Sdial NOSCRIPT
  1414.             
  1415.             SDial specifies the entry to be dialed.
  1416.             SDial                                  
  1417.             NOSCRIPT (written  without quote  marks) indicates  that the
  1418.             NOSCRIPT                                                    
  1419.             automatic invocation  of the  associated dialing  script, if
  1420.             any, is to be suppressed.
  1421.             
  1422.             For example, to dial directory entry 3, use the command:
  1423.             
  1424.                  Dial "3"
  1425.             
  1426.             You can add the dialing prefix characters if you wish:
  1427.             
  1428.                  Dial "-3"
  1429.             
  1430.             You can  also request  a manual dial by prefixing the entire
  1431.             number with an M:
  1432.             
  1433.                  Dial "M1234567"
  1434.             
  1435.             If the  string variable  EntryNum contains "-3" then you can
  1436.             write:
  1437.             
  1438.                  Dial EntryNum
  1439.             
  1440.             If you  don't want  the associated  script for entry 3 to be
  1441.             invoked, then write:
  1442.             
  1443.                  Dial EntryNum NOSCRIPT
  1444.             
  1445.             
  1446.             DirFirst -- Find First Matching File
  1447.             DirFirst -- Find First Matching File
  1448.             
  1449.             DirFirst, combined  with DirNext  (described below),  allows
  1450.             DirFirst                 DirNext                            
  1451.             you to  search DOS  directories for  file names  matching  a
  1452.             wildcard specification.  The syntax of DirFirst is:
  1453.             
  1454.                  DirFirst Spec Srchattr Sname Sattr Sdate Stime Size
  1455.             
  1456.  
  1457.  
  1458.             PibTerm Script Language Reference Guide              Page 19
  1459.             PibTerm Script Language Reference Guide              Page 19
  1460.  
  1461.  
  1462.             Spec is  a string  containing the wildcard specification for
  1463.             Spec                                                        
  1464.             the search.   Only files matching this specification will be
  1465.             selected.  Here are some examples of legal wildcards:
  1466.             
  1467.                  *.*                 All files.
  1468.                  c:\bogus\*.pas      All  files  in  subdirectory  *.pas
  1469.                                      with the extension '.pas'.
  1470.                  myfile.dat               Only the file 'myfile.dat'.
  1471.                  
  1472.             
  1473.             Srchattr is  a string  which specifies which file attributes
  1474.             Srchattr                                                    
  1475.             should be  searched for.   Only files matching the specified
  1476.             attributes will be selected.  Here are the various attribute
  1477.             letters and meanings:
  1478.             
  1479.                  A    Archive bit set
  1480.                  D    Directory
  1481.                  H    Hidden
  1482.                  N    Normal file
  1483.                  R    Read-only
  1484.                  S    System
  1485.                  V    Volume label
  1486.             
  1487.             You may  combine attributes.   Specifying  a null string for
  1488.             SrchAttr means  the same  thing  as  combining  ALL  of  the
  1489.             SrchAttr                                                    
  1490.             attributes.  Here are some examples:
  1491.             
  1492.                  "N"  Select normal files only
  1493.                  "HS" Select hidden system files only
  1494.                  "V"  Select volume label only
  1495.                  ""   Select ALL files
  1496.             
  1497.             Refer to  your DOS  manual  for  details  about  these  file
  1498.             attributes.
  1499.             
  1500.             Sname gets  the name of the first file (if any) matching the
  1501.             Sname                                                       
  1502.             given specification and attributes.  If no files match, then
  1503.             Sname will be an empty string.
  1504.             Sname                         
  1505.             
  1506.             Sattr gets  the attributes  associated with  the file  as  a
  1507.             Sattr                                                       
  1508.             string.   The attribute  string  is  composed  of  the  same
  1509.             letters described  above for  the Srchattr  parameter.  Note
  1510.                                               Srchattr                  
  1511.             that there  may be  MORE attributes for a particular file in
  1512.             Sattr than in Srchattr.
  1513.             Sattr         Srchattr 
  1514.             
  1515.             Sdate gets  the creation  date of the file as a string.  The
  1516.             Sdate                                                       
  1517.             date  format  is  controlled  by  the  setting  of  the  DF=
  1518.             parameter (see the PibTerm Parameter Reference Manual).
  1519.             
  1520.             Stime gets  the creation  time of the file as a string.  The
  1521.             Stime                                                       
  1522.             time format is controlled by the TF= parameter.
  1523.             
  1524.             Size gets the size of the file in bytes as a string.
  1525.             Size                                                
  1526.             
  1527.  
  1528.  
  1529.             PibTerm Script Language Reference Guide              Page 20
  1530.             PibTerm Script Language Reference Guide              Page 20
  1531.  
  1532.  
  1533.             Here is an example in which DirFirst is used to retrieve and
  1534.             display the  volume label  of the  current logged drive (DOS
  1535.             3.0 and above only):
  1536.             
  1537.             
  1538.                  Declare VolID String
  1539.                  Declare Drive String
  1540.                  Declare Dir String
  1541.                  Declare Attr String
  1542.                  Declare Date String
  1543.                  Declare Time String
  1544.                  Declare Size String
  1545.                  *
  1546.                  *                             Get current drive/dir
  1547.                  *
  1548.                  GetDir Drive Dir
  1549.                  *
  1550.                  *                             Append colon to drive
  1551.                  *
  1552.                  Set Drive = CONCAT( Drive , ':' )
  1553.                  *
  1554.                  *                             Look for volume label
  1555.                  *
  1556.                  DirFirst Drive "V" VolID Attr Date Time Size
  1557.                  *
  1558.                  *                             Display if found
  1559.                  *
  1560.                  IF ( VolID <> '' ) THEN
  1561.                       Set VolID = CONCAT( 'Volume: ', VolID )
  1562.                       Set VolID = CONCAT( CONCAT( VolID , '   Created: ' ), Date )
  1563.                       Set VolID = CONCAT( CONCAT( VolID , ' ' ), Time )
  1564.                       Writeln
  1565.                       Writeln VolID
  1566.                  ELSE
  1567.                       Writeln
  1568.                       Writeln "Volume label not found."
  1569.                  ENDIF
  1570.             
  1571.             
  1572.             DirNext -- Find Next Matching File
  1573.             DirNext -- Find Next Matching File
  1574.             
  1575.             DirNext  returns   further   files   matching   a   wildcard
  1576.             DirNext                                                     
  1577.             specification provided by a previously executed DirFirst.
  1578.             
  1579.             The syntax of DirNext is:
  1580.             
  1581.                  DirNext   Sname Sattr Sdate Stime Size
  1582.             
  1583.             where Sname  through Size  have the  same  meanings  as  for
  1584.                   Sname          Size                                   
  1585.             DirFirst above.
  1586.             
  1587.             Here is  a script  which prompts for a file specification to
  1588.             be searched for, and then lists the matching files and sizes
  1589.             on the display:
  1590.  
  1591.  
  1592.             PibTerm Script Language Reference Guide              Page 21
  1593.             PibTerm Script Language Reference Guide              Page 21
  1594.  
  1595.  
  1596.             
  1597.             *                                   Wildcard for files
  1598.              Declare FSpec String
  1599.             *                                   Attributes for search
  1600.              Declare FAttr String
  1601.             *                                   File name
  1602.              Declare FileName String
  1603.             *                                   File attributes
  1604.              Declare FileAttr String
  1605.             *                                   File creation date
  1606.              Declare FileDate String
  1607.             *                                   File creation time
  1608.              Declare FileTime String
  1609.             *                                   File size in bytes
  1610.              Declare FileSize String
  1611.             *                                   Report line
  1612.              Declare ReportLine String
  1613.             *                                   Counts files found
  1614.              Declare TotalFiles Integer
  1615.             *
  1616.             *                                   Get file spec to search for
  1617.             *
  1618.              Writeln
  1619.              Input "Enter file spec to search for: " FSpec
  1620.              Writeln
  1621.             *
  1622.             *                                   If file spec null, quit.
  1623.             *
  1624.              IF ( FSpec = '' ) THEN
  1625.                 Exit
  1626.              ENDIF
  1627.             *
  1628.             *                                   Search for first file.
  1629.             *
  1630.              DirFirst FSpec "" FileName FileAttr FileDate FileTime FileSize
  1631.             *
  1632.             *                                   No first file -- report that
  1633.             *                                   and quit.
  1634.             *
  1635.              IF ( ( FileName = '' ) OR ( IOResult <> 0 ) ) THEN
  1636.                 Writeln
  1637.                 Writeln "No files found."
  1638.                 Writeln
  1639.                 Exit
  1640.              ENDIF
  1641.             *                                   Set files found to 0.
  1642.              Set TotalFiles = 0
  1643.             *
  1644.             *                                   Begin loop over rest of files.
  1645.             *
  1646.              WHILE ( LENGTH( FileName ) <> 0 ) DO
  1647.             *
  1648.             *                                   Increment file count
  1649.             *
  1650.  
  1651.  
  1652.             PibTerm Script Language Reference Guide              Page 22
  1653.             PibTerm Script Language Reference Guide              Page 22
  1654.  
  1655.  
  1656.                 Set TotalFiles = TotalFiles + 1
  1657.             *
  1658.             *                                   Display file stuff
  1659.             *
  1660.                 Set FileName = CONCAT( FileName , DUPL( ' ' , 14 - LENGTH( FileName ) ) )
  1661.                 Set FileSize = CONCAT( DUPL( ' ' , 12 - LENGTH( FileSize ) ) , FileSize )
  1662.                 Set FileSize = CONCAT( FileSize , ' ' )
  1663.                 Set FileDate = CONCAT( FileDate , ' ' )
  1664.                 Set FileTime = CONCAT( FileTime , ' ' )
  1665.             *
  1666.                 Set ReportLine = CONCAT( CONCAT( FileName , FileSize ), FileDate )
  1667.                 Set ReportLine = CONCAT( CONCAT( ReportLine , FileTime ), FileAttr )
  1668.             *
  1669.                 Writeln ReportLine
  1670.             *                                   Get next file
  1671.             *
  1672.                 DirNext FileName FileAttr FileDate FileTime FileSize
  1673.             *
  1674.              ENDWHILE
  1675.             *                                   Display final count of files
  1676.             *
  1677.              Set ReportLine = CONCAT( 'Total files found: ', STRING( TotalFiles ) )
  1678.             *
  1679.              Writeln
  1680.              Writeln ReportLine
  1681.             
  1682.             
  1683.             DoCase -- Do Case Statement
  1684.             DoCase -- Do Case Statement
  1685.             
  1686.             The DoCase  statement starts  a  multiway  selection  block.
  1687.                 DoCase                                                  
  1688.             The syntax of DoCase is as follows:
  1689.             
  1690.                  DOCASE var
  1691.                     CASE value1
  1692.                        ...
  1693.                     ENDCASE
  1694.                     CASE value2
  1695.                        ...
  1696.                     ENDCASE
  1697.                        ...
  1698.                     CASE ELSE
  1699.                        ...
  1700.                     ENDCASE
  1701.                  ENDDOCASE
  1702.             
  1703.             'var' can  be  either  an  integer  or  a  string  variable.
  1704.             'value1', 'value2',  etc. are the case-selection values.  If
  1705.             the value  of 'var'  matches one  of the  'value(n)' values,
  1706.             then  the   statements  following  that  CASE  value(n)  are
  1707.             executed.     CASE  ELSE  provides  a  means  for  executing
  1708.             statements if  the  value  of  'var'  matched  none  of  the
  1709.             'value(n)' values.
  1710.             
  1711.  
  1712.  
  1713.             PibTerm Script Language Reference Guide              Page 23
  1714.             PibTerm Script Language Reference Guide              Page 23
  1715.  
  1716.  
  1717.             DoCase provides a convenient alternative to a long series of
  1718.             nested IF statements.
  1719.             
  1720.             Examples:
  1721.             
  1722.                  DECLARE  I  Integer
  1723.                  DECLARE  S  String
  1724.                   ...
  1725.                  DOCASE I
  1726.                     CASE 1
  1727.                       ...
  1728.                     ENDCASE
  1729.                     CASE 2
  1730.                       ...
  1731.                     ENDCASE
  1732.                     CASE 3
  1733.                       ...
  1734.                     ENDCASE
  1735.                     CASE ELSE
  1736.                       ...
  1737.                     ENDCASE
  1738.                  ENDDOCASE
  1739.             
  1740.                  DOCASE S
  1741.                     CASE 'VT100'
  1742.                       ...
  1743.                     ENDCASE
  1744.                     CASE 'VT52'
  1745.                       ...
  1746.                     ENDCASE
  1747.                     CASE 'ANSI'
  1748.                       ...
  1749.                     ENDCASE
  1750.                     CASE ELSE
  1751.                       ...
  1752.                     ENDCASE
  1753.                  ENDDOCASE
  1754.             
  1755.             For another  example, see  the definition of the EMULATE.SCR
  1756.             script in the description of the AddCommand command above.
  1757.             
  1758.             
  1759.             Dos -- Execute DOS Command
  1760.             Dos -- Execute DOS Command
  1761.             
  1762.             Dos executes  a  specified  DOS  command  --  somewhat  like
  1763.             Dos                                                         
  1764.             <ALT>J, but only for a single command.  The syntax is:
  1765.             
  1766.                  Dos Sdos
  1767.             
  1768.             Sdos specifies the DOS command to be executed.
  1769.             Sdos                                          
  1770.             
  1771.             For example, to execute a DIR command, enter:
  1772.             
  1773.                  Dos "DIR"
  1774.  
  1775.  
  1776.             PibTerm Script Language Reference Guide              Page 24
  1777.             PibTerm Script Language Reference Guide              Page 24
  1778.  
  1779.  
  1780.             
  1781.             If the  script variable  'Doscom' contains  'DIR' you  could
  1782.             write:
  1783.             
  1784.                  Dos Doscom
  1785.             
  1786.             To jump to a new copy of DOS, write:
  1787.             
  1788.                  Dos ""
  1789.             
  1790.             Dos automatically  returns to  PibTerm after  executing  the
  1791.             Dos                                                         
  1792.             single  specified  MS  DOS  command,  unless  the  specified
  1793.             command is  null.  In that case, Dos  invokes a new level of
  1794.                                              Dos                        
  1795.             the MS  DOS command  processor, and  you will  have to enter
  1796.             EXIT to return to PibTerm.  This is the same behavior as for
  1797.             the <ALT>J command.
  1798.             
  1799.             
  1800.             Echo -- Toggle Local Echo
  1801.             Echo -- Toggle Local Echo
  1802.             
  1803.             Echo toggles  local echo  mode, just like the keyboard entry
  1804.             Echo                                                        
  1805.             <ALT>E. In  local echo  mode, PibTerm displays characters as
  1806.             you type  them, and  doesn't wait  for the  remote system to
  1807.             echo them back.
  1808.             
  1809.             
  1810.             EditFile -- Invoke File Editor
  1811.             EditFile -- Invoke File Editor
  1812.             
  1813.             EditFile invokes  the currently  defined editor specified by
  1814.             the EN=  parameter.   If the  value of EN= is null, then the
  1815.             built-in PibTerm  editor is  invoked.  Otherwise, the string
  1816.             specified as  the value of EN= is executed as a DOS command,
  1817.             after making  any required  file name  substitution (see the
  1818.             description of  the EN=  parameter in the "PibTerm Parameter
  1819.             Reference Manual" for details).
  1820.             
  1821.             The syntax of EditFile is:
  1822.             
  1823.                  EditFile  Sname
  1824.             
  1825.             Sname specifies the name of the file to be edited.
  1826.             Sname                                             
  1827.             
  1828.             For example,  to invoke  the editor  for file "BOGUSCO.DAT",
  1829.             you could write:
  1830.             
  1831.                  EditFile "Bogusco.dat"
  1832.             
  1833.             
  1834.             Else -- Part Of IF Statement
  1835.             Else -- Part Of IF Statement
  1836.             
  1837.             Else is described as part of the If command below.
  1838.             Else                                              
  1839.             
  1840.             
  1841.  
  1842.  
  1843.             PibTerm Script Language Reference Guide              Page 25
  1844.             PibTerm Script Language Reference Guide              Page 25
  1845.  
  1846.  
  1847.             EndCase -- Ends Case Block
  1848.             EndCase -- Ends Case Block
  1849.             
  1850.             EndCase is described as part of the DoCase command above.
  1851.             EndCase                                                  
  1852.             
  1853.             
  1854.             EndDoCase -- Ends DoCase Statement
  1855.             EndDoCase -- Ends DoCase Statement
  1856.             
  1857.             EndDoCase is described as part of the DoCase command above.
  1858.             EndDoCase                                                  
  1859.             
  1860.             
  1861.             EndIf -- Ends an IF Statement
  1862.             EndIf -- Ends an IF Statement
  1863.             
  1864.             EndIf is described as part of the 'If' command below.
  1865.             EndIf                                                
  1866.             
  1867.             
  1868.             EndProc -- Ends a Script Procedure
  1869.             EndProc -- Ends a Script Procedure
  1870.             
  1871.             EndProc is described as part of the Procedure command below.
  1872.             EndProc                                                     
  1873.             
  1874.             
  1875.             EndWhile -- Ends a WHILE Block
  1876.             EndWhile -- Ends a WHILE Block
  1877.             
  1878.             EndWhile is  described as  part  of  the  'While'  statement
  1879.             EndWhile                                                    
  1880.             below.
  1881.             
  1882.             
  1883.             EraseFile -- Erase (Delete) A File
  1884.             EraseFile -- Erase (Delete) A File
  1885.             
  1886.             EraseFile erases (deletes) a file.  The syntax is:
  1887.             EraseFile                                         
  1888.             
  1889.                  EraseFile Sname
  1890.             
  1891.             Sname specifies the name of the file to be erased.
  1892.             Sname                                             
  1893.             
  1894.             For example,  to erase  the file  "BOGUSCO.DAT",  you  could
  1895.             write the following script command:
  1896.             
  1897.                  EraseFile "Bogusco.dat"
  1898.             
  1899.             This is equivalent to issuing the DOS command:
  1900.             
  1901.                  ERASE BOGUSCO.DAT
  1902.             
  1903.             
  1904.             Execute -- Execute One Script From Another
  1905.             Execute -- Execute One Script From Another
  1906.             
  1907.             Scripts may  invoke  other  scripts.    The  Execute  script
  1908.                                                          Execute        
  1909.             command provides the necessary mechanism.  The syntax of the
  1910.             Execute command is:
  1911.             
  1912.                  Execute Sname <Arguments>
  1913.             
  1914.             Sname is the name of the script to be invoked.
  1915.             Sname                                         
  1916.             
  1917.  
  1918.  
  1919.             PibTerm Script Language Reference Guide              Page 26
  1920.             PibTerm Script Language Reference Guide              Page 26
  1921.  
  1922.  
  1923.             <Arguments> is  a list  of variables  or constants  (but NOT
  1924.             <Arguments                                                  
  1925.             expressions) to  be passed  as  arguments  to  the  executed
  1926.             script.   This is essentially the same format as for calling
  1927.             an internal  script procedure  (see Call), except that Sname
  1928.                                                 Call               Sname
  1929.             here refers to  an external script.
  1930.             
  1931.             Here is a script which invokes three other scripts:
  1932.             
  1933.                  DECLARE I Integer
  1934.                  DECLARE S String
  1935.                  DECLARE name String 'Other2'
  1936.                  ...
  1937.                  Message " "
  1938.                  Message "We will now invoke three scripts."
  1939.                  Message " "
  1940.                  Execute 'OTHER1' 23 'VT100' S
  1941.                  Execute name I
  1942.                  Execute 'OTHER3'
  1943.             
  1944.             The three scripts OTHER1, OTHER2, and OTHER3 will be invoked
  1945.             and executed.
  1946.             
  1947.             The TYPE  of the arguments passed is NOT CHECKED by PibTerm.
  1948.             If you  make a  mistake, you  may get  bizarre results.  The
  1949.             NUMBER of  arguments IS checked, and the invoked script will
  1950.             NOT  be  executed  if  the  wrong  number  of  arguments  is
  1951.             provided.
  1952.             
  1953.             Arguments are  passed to  a nested  script using  the Import
  1954.                                                                   Import
  1955.             script statement.  See the definition of Import for details.
  1956.             
  1957.             The <ALT>X  command exits  one level  of script nesting at a
  1958.             time.  You may need to repeat it several times to get out of
  1959.             all the  scripts.  The script command Exitall will also take
  1960.                                                   Exitall               
  1961.             you out of all scripts, regardless of nesting depth.
  1962.             
  1963.             Here is  an extended example of an executed script.  Suppose
  1964.             we want  to construct a script to prompt a remote caller and
  1965.             handle  sending   of  files.    The  script  will  take  two
  1966.             arguments, the  file name of the file(s) to be send, and the
  1967.             transfer protocol.  If either or both aren't specified, then
  1968.             the executed  script will  prompt for them.  We'll call this
  1969.             script SENDIT:
  1970.             
  1971.                  IMPORT  Filename String
  1972.                  IMPORT  Protocol String
  1973.                  *
  1974.                  DECLARE Temp     String
  1975.                  *
  1976.                  *        Check if file name provided.  Prompt if missing.
  1977.                  *
  1978.                        WHILE( LENGTH(FileName) = 0 ) DO
  1979.                           RInput  "Enter name of file to transfer: " Filename
  1980.                        ENDWHILE
  1981.  
  1982.  
  1983.             PibTerm Script Language Reference Guide              Page 27
  1984.             PibTerm Script Language Reference Guide              Page 27
  1985.  
  1986.  
  1987.                  *
  1988.                  *        Check if file exists.  If not, quit.
  1989.                  *
  1990.                        IF ( NOT FILEEXISTS( Filename ) ) THEN
  1991.                           SET Temp = CONCAT( CONCAT( "The file ", Filename ), " does not exist.|")
  1992.                           SText Temp
  1993.                           Quit
  1994.                        ENDIF
  1995.                  *
  1996.                  *        Check if protocol provided.  Prompt if missing.
  1997.                  *
  1998.                        WHILE( LENGTH( Protocol ) = 0 ) DO
  1999.                           RInput  "Enter protocol to use:          " Protocol
  2000.                        ENDIF
  2001.                  *
  2002.                  *        Check if protocol is legitimate; send file if so.
  2003.                  *
  2004.                        IF POS( Protocol , 'X,XC,Y,YB,TE' ) > 0 THEN
  2005.                           Send Filename Protocol
  2006.                        ELSE
  2007.                           SText   "Invalid protocol name.|"
  2008.                        ENDIF
  2009.                  
  2010.             We could invoke this script as:
  2011.                  
  2012.                       SENDIT  '' ''
  2013.             
  2014.             This would prompt the remote caller for the file name and
  2015.             transfer type.
  2016.             
  2017.             
  2018.             Exit -- Terminate Script Execution
  2019.             Exit -- Terminate Script Execution
  2020.             
  2021.             Exit  terminates   execution  of   the  script.      PibTerm
  2022.             Exit                                                        
  2023.             automatically inserts an Exit at the end of a script, so you
  2024.                                      Exit                               
  2025.             need not  provide it  there.   Exit is  most useful when you
  2026.             want to  stop script  execution somewhere in the middle of a
  2027.             script.
  2028.             
  2029.             Exit only  stops the current script.  If you are in a nested
  2030.             script, control is returned to the invoking script.  To exit
  2031.             all scripts, use the ExitAll command instead.
  2032.             
  2033.             Note that terminating a script does NOT terminate processing
  2034.             of any defined 'When' string.  See the section on the 'When'
  2035.             script command below for further details.
  2036.             
  2037.             
  2038.             ExitAll -- Exit Nested Scripts
  2039.             ExitAll -- Exit Nested Scripts
  2040.             
  2041.             ExitAll stops  executing the  current script,  regardless of
  2042.             ExitAll                                                     
  2043.             the nesting  depth.    All  higher-level  scripts  are  also
  2044.             stopped.
  2045.             
  2046.  
  2047.  
  2048.             PibTerm Script Language Reference Guide              Page 28
  2049.             PibTerm Script Language Reference Guide              Page 28
  2050.  
  2051.  
  2052.             
  2053.             For -- Start FOR Loop
  2054.             For -- Start FOR Loop
  2055.             
  2056.             A For loop has the form:
  2057.               For                   
  2058.             
  2059.                  FOR index = start-expression TO     end-expression DO
  2060.                      ...
  2061.                      other statements
  2062.                      ...
  2063.                  ENDFOR
  2064.                                    -or-
  2065.             
  2066.                  FOR index = start-expression DOWNTO end-expression DO
  2067.                      ...
  2068.                      other statements
  2069.                      ...
  2070.                  ENDFOR
  2071.             
  2072.             'index' is  an integer  variable name;    'start-expression'
  2073.             gives the  initial loop  value;   'end-expression' gives the
  2074.             final loop value. 'TO' specifies an ascending loop; 'DOWNTO'
  2075.             specifies a descending loop. The increment is always 1.
  2076.             
  2077.             Examples:
  2078.             
  2079.                DECLARE I Integer
  2080.                   ...
  2081.             
  2082.                FOR I = 1 TO 10 DO
  2083.                   ...
  2084.                ENDFOR
  2085.             
  2086.                FOR I = 10 DOWNTO 1 DO
  2087.                   ...
  2088.                ENDFOR
  2089.             
  2090.                FOR I := ( J * 10 - I ) TO ( K - 32 ) DO
  2091.                   ...
  2092.                ENDFOR
  2093.             
  2094.             
  2095.             FreeSpace -- Find Free Space On Drive
  2096.             FreeSpace -- Find Free Space On Drive
  2097.             
  2098.             FreeSpace finds the number of bytes of space which are still
  2099.             FreeSpace                                                   
  2100.             unused on a drive.  The syntax is:
  2101.             
  2102.                  FreeSpace Sdrive Sfree
  2103.             
  2104.             Sdrive specifies  the drive  for which  the  free  space  is
  2105.             Sdrive                                                      
  2106.             desired.
  2107.             
  2108.             Sfree gets the free space as a string.
  2109.             Sfree                                 
  2110.             
  2111.  
  2112.  
  2113.             PibTerm Script Language Reference Guide              Page 29
  2114.             PibTerm Script Language Reference Guide              Page 29
  2115.  
  2116.  
  2117.             For example,  to find  the number  of free bytes on drive C:
  2118.             write:
  2119.             
  2120.                  Declare Size String
  2121.                  FreeSpace "C:" Size
  2122.                  Writeln Size
  2123.             
  2124.             
  2125.             GetDir -- Get Current Directory And Drive
  2126.             GetDir -- Get Current Directory And Drive
  2127.             
  2128.             GetDir retrieves  the currently  logged  drive  and  MS  DOS
  2129.             GetDir                                                      
  2130.             subdirectory.  The syntax is:
  2131.             
  2132.                  GETDIR  Sdrive Sdir
  2133.             
  2134.             Sdrive is a string variable which receives the current drive
  2135.             Sdrive                                                      
  2136.             letter (without a trailing colon).
  2137.             
  2138.             Sdir  is  a  string  variable  which  receives  the  current
  2139.             Sdir                                                        
  2140.             subdirectory, without initial or trailing slashes.
  2141.             
  2142.             Example:
  2143.             
  2144.             Suppose  that   the  current  path  is  "c:\bogus".    After
  2145.             executing the following script statements:
  2146.             
  2147.                  Declare drive string
  2148.                  Declare drive dir
  2149.                  GetDir drive dir
  2150.             
  2151.             The resulting values are:
  2152.             
  2153.                  drive     contains C
  2154.                  drive               
  2155.                  dir       contains BOGUS
  2156.                  dir                     
  2157.             
  2158.             
  2159.             GetParam -- Get Value of PibTerm Parameter
  2160.             GetParam -- Get Value of PibTerm Parameter
  2161.             
  2162.             GetParam retrieves  the current value of a PibTerm parameter
  2163.             GetParam                                                    
  2164.             variable.  The syntax is:
  2165.             
  2166.                GetParam  Spname  Svalue
  2167.             
  2168.             Spname is  the two-character  name of  the parameter  to  be
  2169.             Spname                                                      
  2170.             retrieved.   Spname can  be  either  a  string  variable  or
  2171.             constant.
  2172.             
  2173.             Svalue is  the current value of that parameter.  Svalue must
  2174.             Svalue                                                      
  2175.             be a string variable.
  2176.             
  2177.             See the  "PibTerm Parameters Reference Guide" for a complete
  2178.             list of the parameter names and types.
  2179.             
  2180.  
  2181.  
  2182.             PibTerm Script Language Reference Guide              Page 30
  2183.             PibTerm Script Language Reference Guide              Page 30
  2184.  
  2185.  
  2186.             Parameters whose values are integers are converted to string
  2187.             form for  storage in  Svalue.   Parameters whose  values are
  2188.                                   Svalue                                
  2189.             boolean are  converted to "1" for a true value and "0" for a
  2190.             false value.
  2191.             
  2192.             Requesting a  non-existent parameter  name results in Svalue
  2193.                                                                   Svalue
  2194.             being set to an empty string.
  2195.             
  2196.             To avoid  excessive code overlay swaps, try to keep a series
  2197.             of GetParam statements together in your script.
  2198.             
  2199.             Example:
  2200.             
  2201.             Suppose that  the current baud rate is 2400; that PibTerm is
  2202.             NOT  set   for  hard-wired   access;  and   that  the  modem
  2203.             initialization string  is "ATZ".   Then  after executing the
  2204.             following script statements:
  2205.             
  2206.             *
  2207.                  Declare ModemInit String
  2208.                  Declare BaudRate  String
  2209.                  Declare HardWired String
  2210.                  Declare PName     String
  2211.                  *
  2212.                  *          Get modem initialization string (string)
  2213.                  *
  2214.                  GetParam  'mi' ModemInit
  2215.                  *
  2216.                  *          Get baud rate (integer variable)
  2217.                  *
  2218.                  Set       PName  = 'ba'
  2219.                  GetParam  PName BaudRate
  2220.                  *
  2221.                  *          Get hardwired status
  2222.                  *
  2223.                  GetParam  'hw' HardWired
  2224.             
  2225.             the resulting values are (all strings):
  2226.             
  2227.                  ModemInit      ATZ
  2228.                  BaudRate       2400
  2229.                  HardWired      0
  2230.             
  2231.             
  2232.             GetVar -- Get Value of Script Variable
  2233.             GetVar -- Get Value of Script Variable
  2234.             
  2235.             GetVar retrieves  the current  value of a script variable by
  2236.             GetVar                                                      
  2237.             name.  The syntax is:
  2238.             
  2239.                  GetVar Sname Stype Svalue
  2240.             
  2241.             Sname is the name of the variable whose value is wanted.
  2242.             Sname                                                   
  2243.             
  2244.  
  2245.  
  2246.             PibTerm Script Language Reference Guide              Page 31
  2247.             PibTerm Script Language Reference Guide              Page 31
  2248.  
  2249.  
  2250.             Stype  returns   the  type   ("INTEGER",  "STRING")  of  the
  2251.             Stype                                                       
  2252.             variable.
  2253.             
  2254.             Svalue returns  the current value of the variable, converted
  2255.             Svalue                                                      
  2256.             to a string value if necessary. The most current instance of
  2257.             the variable  name is  returned.   That means  in  a  nested
  2258.             script or  script procedure,  the value from the most recent
  2259.             definition of the variable is used.
  2260.             
  2261.             If the  given variable  name  doesn't  exist,  the  type  is
  2262.             returned as  "UNDEFINED" and  the value  is returned  as  an
  2263.             empty string.
  2264.             
  2265.             GetVar is  useful when  you  don't  know  the  name  of  the
  2266.             variable for  which you  want a  value until  the script  is
  2267.             being executed.   If  you do  know the name of the variable,
  2268.             you should  use the  Set  command  instead,  which  is  more
  2269.                                  Set                                    
  2270.             efficient.
  2271.             
  2272.             As an  example, suppose  that the  variable VARA is a string
  2273.                                                         VARA            
  2274.             variable with  the current  value "bogus value".  Then after
  2275.             executing the following script statements:
  2276.             
  2277.                  Declare vtype string
  2278.                  Declare vval  string
  2279.                  Declare vname string
  2280.                       ...
  2281.                  GetVar 'VARA' vtype vval
  2282.                  SET vname = 'VARA'
  2283.                  GetVar vname vtype vval
  2284.             
  2285.             the resulting values are:
  2286.             
  2287.                  vname     VARA
  2288.                  vtype     STRING
  2289.                  vval      bogus value
  2290.             
  2291.             
  2292.             GoToXY -- Move To Specified Screen Position
  2293.             GoToXY -- Move To Specified Screen Position
  2294.             
  2295.             GoToXY positions the cursor to a specified row and column on
  2296.             GoToXY                                                      
  2297.             the screen.  The syntax is:
  2298.             
  2299.                  GoToXY IX IY
  2300.             
  2301.             IX is  the new  column position,  and  IY  is  the  new  row
  2302.             IX                                     IY                   
  2303.             position.
  2304.             
  2305.             Examples:
  2306.             
  2307.             
  2308.                  *
  2309.                  *                Move to column 1, row 12
  2310.                  *
  2311.  
  2312.  
  2313.             PibTerm Script Language Reference Guide              Page 32
  2314.             PibTerm Script Language Reference Guide              Page 32
  2315.  
  2316.  
  2317.                  GoToXY  1 12
  2318.                  *
  2319.                  *                Move to column 2, row 23
  2320.                  *
  2321.                  Set I1 = 2
  2322.                  Set I2 = 23
  2323.                  GoToXY  I1 I2
  2324.                  
  2325.             
  2326.             
  2327.             Hangup -- Hang Up The Phone
  2328.             Hangup -- Hang Up The Phone
  2329.             
  2330.             Hangup hangs  up the  phone, just  like the  keyboard  entry
  2331.             Hangup                                                      
  2332.             <ALT>H.
  2333.             
  2334.             
  2335.             Host -- Enter Host Mode
  2336.             Host -- Enter Host Mode
  2337.             
  2338.             Host causes  PibTerm to  enter  Host  mode,  just  like  the
  2339.             Host                                                        
  2340.             keyboard command  <ALT>W.   In this mode PibTerm acts like a
  2341.             mini-BBS (bulletin  board system).  Remote callers  can dial
  2342.             your system and transfers files and leave messages.  See the
  2343.             section on  PibTerm host  mode in the "PibTerm User's Guide"
  2344.             for more details.
  2345.             
  2346.             
  2347.             If -- Conditionally Execute Statements
  2348.             If -- Conditionally Execute Statements
  2349.             
  2350.             If allows  testing of  several different types of conditions
  2351.             If                                                          
  2352.             and conditionally  executing  a  block  of  statements.  The
  2353.             general form of the 'If' statement in PibTerm is:
  2354.             
  2355.                IF  ( condition ) THEN
  2356.                  < script statements executed if condition is TRUE >
  2357.                ELSE
  2358.                  < script statements executed of condition is FALSE >
  2359.                ENDIF
  2360.             
  2361.             The Else  part is  optional and  need not be specified.  You
  2362.                 Else                                                    
  2363.             MUST specify  the Endif.   IF statements can be nested up to
  2364.                               Endif                                     
  2365.             64 levels deep.
  2366.             
  2367.             The "( condition )" must be an expression which evaluates to
  2368.             either zero  (false) or  non-zero (true).    Basically,  the
  2369.             "condition" is  of the  form "v1  OP v2" where v1 and v2 are
  2370.                                                            v1     v2    
  2371.             script variables  or  functions,  and  OP  is  a  relational
  2372.                                                    OP                   
  2373.             operator. The  available functions  are described  under the
  2374.             Set command below. The available relational operators are:
  2375.             Set                                                       
  2376.             
  2377.                  =, <, >, <>, <=, >=, NOT, AND, OR, XOR
  2378.             
  2379.             Examples:
  2380.             
  2381.                  IF ( a = b ) THEN
  2382.  
  2383.  
  2384.             PibTerm Script Language Reference Guide              Page 33
  2385.             PibTerm Script Language Reference Guide              Page 33
  2386.  
  2387.  
  2388.                       ...
  2389.                  ENDIF
  2390.             
  2391.                  IF ( a <> 'Where''s the beef?' ) THEN
  2392.                  ...
  2393.                  ENDIF
  2394.             
  2395.                  IF ( c <= 25 ) THEN
  2396.                  ...
  2397.                  ENDIF
  2398.             
  2399.                  IF ( NOT ( a = b ) ) THEN
  2400.                  ...
  2401.                  ENDIF
  2402.             
  2403.             Compound conditions are allowed, for example:
  2404.             
  2405.                  IF ( ( a = b ) AND ( NOT CONNECTED ) ) THEN
  2406.                  ...
  2407.                  ENDIF
  2408.             
  2409.             String  comparisons   use  the  ASCII  character  set  as  a
  2410.             collating sequence.
  2411.             
  2412.             These same conditional expressions can be used in all of the
  2413.             other conditional commands like WHILE, UNTIL, and so on.
  2414.             
  2415.             
  2416.             Import -- Import Variable To Executed Script
  2417.             Import -- Import Variable To Executed Script
  2418.             
  2419.             A script invoked using the Execute script statement needs to
  2420.                                        Execute                          
  2421.             indicate which  variables are  being passed  to it.  This is
  2422.             done using the IMPORT command, which has the syntax:
  2423.             
  2424.                  Import varname type
  2425.             
  2426.             Imported variables may be used just like Declared variables.
  2427.             You can  also Declare  variables which  will be local to the
  2428.             Executed script.
  2429.             Execute         
  2430.             
  2431.             Here is the same main script as given in the Execute command
  2432.             description:
  2433.             
  2434.                  DECLARE I Integer
  2435.                  DECLARE S String
  2436.                  DECLARE name String 'Other2'
  2437.                  ...
  2438.                  Message " "
  2439.                  Message "We will now invoke three scripts."
  2440.                  Message " "
  2441.                  Execute 'OTHER1' 23 'VT100' S
  2442.                  Execute name I
  2443.                  Execute 'OTHER3'
  2444.             
  2445.  
  2446.  
  2447.             PibTerm Script Language Reference Guide              Page 34
  2448.             PibTerm Script Language Reference Guide              Page 34
  2449.  
  2450.  
  2451.             
  2452.             The first three statements of script OTHER1 above might look
  2453.             like this:
  2454.             
  2455.                  IMPORT N        Integer
  2456.                  IMPORT TermType String
  2457.                  IMPORT Message  String
  2458.                     ...
  2459.                  
  2460.             
  2461.             The Import statements connect the variables N, TermType, and
  2462.             Message in  the script OTHER1 with the variables passed from
  2463.             the main  script, which may have quite different names.  For
  2464.             example:
  2465.             
  2466.                  Execute 'other1' 23 'vt100' S
  2467.                  
  2468.             results in the following matchups:
  2469.             
  2470.                  N         <-- 23
  2471.                  TermType  <-- 'VT100'
  2472.                  Message   <-- S
  2473.             
  2474.             As with internal script procedures, you may alter the values
  2475.             of IMPORTed  variables and the new values ARE passed back to
  2476.             the invoking  script IF  the  corresponding  argument  is  a
  2477.             variable.   Changes in  constants are NOT passed back to the
  2478.             invoking script.
  2479.             
  2480.             
  2481.             Input -- Get Input From Keyboard
  2482.             Input -- Get Input From Keyboard
  2483.             
  2484.             Input prompts  for and  reads characters  from the keyboard.
  2485.             Input                                                       
  2486.             The syntax is:
  2487.             
  2488.                  Input Sprompt Sinput
  2489.             
  2490.             Sprompt contains  the prompt  string, which  may be the null
  2491.             Sprompt                                                     
  2492.             string, in which case no prompt is issued.
  2493.             
  2494.             Sinput  receives   the  characters  typed  up  to  (but  not
  2495.             Sinput                                                      
  2496.             including) the terminating carriage return.
  2497.             
  2498.  
  2499.  
  2500.             PibTerm Script Language Reference Guide              Page 35
  2501.             PibTerm Script Language Reference Guide              Page 35
  2502.  
  2503.  
  2504.             Example:
  2505.             
  2506.                  *
  2507.                  *           Read letter into variable answer
  2508.                  *
  2509.                  Declare answer string
  2510.                  Declare prompt string
  2511.                  *
  2512.                  Input 'Enter letter: ' answer
  2513.                  *
  2514.                  *           Read letter into variable answer.
  2515.                  *
  2516.                  Set prompt = 'Enter letter: '
  2517.                  Input prompt answer
  2518.             
  2519.             
  2520.             InsLine -- Insert Line At Cursor
  2521.             InsLine -- Insert Line At Cursor
  2522.             
  2523.             InsLine inserts  a blank  line in  the display following the
  2524.             InsLine                                                     
  2525.             line on  which the  cursor  rests.    All  lines  below  the
  2526.             inserted line  (except the  status line)  are scrolled down,
  2527.             and the last line is scrolled off the screen.
  2528.             
  2529.             
  2530.             Key -- Set Function Key Values
  2531.             Key -- Set Function Key Values
  2532.             
  2533.             Key reads  function keys  from a  specified file,  like  the
  2534.             Key                                                         
  2535.             <ALT>K keyboard  entry "Read  definitions from  a file". The
  2536.             syntax is:
  2537.             
  2538.                  Key Skeyfile
  2539.             
  2540.             Skeyfile is  the name  of the  file containing  the keyboard
  2541.             Skeyfile                                                    
  2542.             definitions.
  2543.             
  2544.             Example:
  2545.             
  2546.             In the following script segment:
  2547.             
  2548.                  *
  2549.                  *          Read keyboard definition from file "mydefs.fnc"
  2550.                  *
  2551.                  Declare KeyFile String
  2552.                  *
  2553.                  Key "mydefs"
  2554.                  *
  2555.                  Set KeyFile = "mydefs"
  2556.                  Key KeyFile
  2557.                  *
  2558.                  Set KeyFile = "mydefs.fnc"
  2559.                  Key KeyFile
  2560.  
  2561.  
  2562.             PibTerm Script Language Reference Guide              Page 36
  2563.             PibTerm Script Language Reference Guide              Page 36
  2564.  
  2565.  
  2566.                  
  2567.                  
  2568.             all three  Key statements  read key  definitions  from  file
  2569.                        Key                                              
  2570.             "mydefs.fnc" -- the ".fnc" is understood.
  2571.                  
  2572.             
  2573.             KeyDef -- Define Function Key Value
  2574.             KeyDef -- Define Function Key Value
  2575.             
  2576.             KeyDef defines a string to be sent to the remote system when
  2577.             KeyDef                                                      
  2578.             a function  key is struck.  This is like the <ALT>K "D)efine
  2579.             key" command. The syntax is:
  2580.             
  2581.                  KeyDef Skeyname Skeytext
  2582.             
  2583.             Skeyname is the name of the key to be defined.
  2584.             Skeyname                                      
  2585.             
  2586.             Skeytext is the text string to be assigned to the key.
  2587.             Skeytext                                              
  2588.             
  2589.             The following key names are used with KeyDef:
  2590.             
  2591.                  F1 through F12 (for function key F1 through F12)
  2592.                  F1         F12                                  
  2593.                  A1 through A12 (for <ALT>F1 though <ALT>F12);
  2594.                  A1         A12                               
  2595.                  C1 through C12 (for <CTRL>F1 through <CTRL>F12);
  2596.                  C1         C12                                  
  2597.                  S1 through S12 (for <SHIFT>F1 through <SHIFT>F12).
  2598.                  S1         S12                                    
  2599.             
  2600.                  N1 through N0  (for <ALT>1 through <ALT>0 on top row
  2601.                  N1         N0                                       
  2602.                                 of the keyboard);
  2603.                  N-             (for <ALT>- on the top keyboard row)
  2604.                  N-                                                 
  2605.                  N+             (for <ALT>+ on the top keyboard row)
  2606.                  N+                                                 
  2607.             
  2608.                  K0 through K9  (for keypad 0 through 9)
  2609.                  K0         K9                          
  2610.                  K.             (for keypad . or DEL key)
  2611.                  K.                                      
  2612.                  K+             (for keypad + )
  2613.                  K+                            
  2614.                  K-             (for keypad - )
  2615.                  K-                            
  2616.                  K*             (for keypad * )
  2617.                  K*                            
  2618.                  K/             (for keypad / )
  2619.                  K/                            
  2620.                  KE             (for keypad enter)
  2621.                  KE                               
  2622.                  AK versions    (for <ALT>keypad 0 through 9, etc.)
  2623.                  AK                                                
  2624.                  CK versions    (for <CTRL>keypad 0 through 9, etc.)
  2625.                  CK                                                 
  2626.             
  2627.                  PS             (for PrtSc)
  2628.                  PS                        
  2629.                  APS            (for <ALT>PrtSc)
  2630.                  APS                            
  2631.                  CPS            (for <CTRL>PrtSc)
  2632.                  CPS                             
  2633.             
  2634.                  AEN            (for <ALT>Enter)
  2635.                  AEN                            
  2636.             
  2637.                  BS             (for Backspace)
  2638.                  BS                            
  2639.                  CBS            (for <CTRL>Backspace)
  2640.                  CBS                                 
  2641.                  ABS            (for <ALT>BackSpace)
  2642.                  ABS                                
  2643.             
  2644.                  XU             (for separate cursor pad up arrow)
  2645.                  XU                                               
  2646.                  XD             (for separate cursor pad down arrow)
  2647.                  XD                                                 
  2648.                  XL             (for separate cursor pad left arrow)
  2649.                  XL                                                 
  2650.                  XR             (for separate cursor pad right arrow)
  2651.                  XR                                                  
  2652.  
  2653.  
  2654.             PibTerm Script Language Reference Guide              Page 37
  2655.             PibTerm Script Language Reference Guide              Page 37
  2656.  
  2657.  
  2658.                  AX versions    (for <ALT>separate cursor pad keys)
  2659.                  AX                                                
  2660.                  CX versions    (for <CTRL>separate cursor pad keys)
  2661.                  CX                                                 
  2662.             
  2663.                  XI             (for separate position pad Insert)
  2664.                  XI                                               
  2665.                  XH             (for separate position pad Home)
  2666.                  XH                                             
  2667.                  XPU            (for separate position pad PageUp)
  2668.                  XPU                                              
  2669.                  XDE            (for separate position pad Delete)
  2670.                  XDE                                              
  2671.                  XE             (for separate position pad End)
  2672.                  XE                                            
  2673.                  XPD            (for separate position pad PageDown)
  2674.                  XPD                                                
  2675.                  AX versions    (for <ALT>separate position pad keys)
  2676.                  AX                                                  
  2677.                  CX versions    (for <CTRL>separate position pad keys)
  2678.                  CX                                                   
  2679.             
  2680.             Not all  keys exist  on all  keyboards.   However,  you  can
  2681.             always assign  values to keys that don't exist on individual
  2682.             keyboards anyway.
  2683.             
  2684.             Examples:
  2685.             
  2686.                  *
  2687.                  Declare KeyName String
  2688.                  Declare KeyDef  String
  2689.                  *
  2690.                  Key 'F1' 'DIR *.*|'
  2691.                  *
  2692.                  Set KeyName = 'F1'
  2693.                  Set KeyDef  = 'DIR *.*|'
  2694.                  KeyDef Keyname KeyDef
  2695.                  KeyDef 'F1' Keydef
  2696.                  KeyDef KeyName 'DIR *.*|'
  2697.             
  2698.             
  2699.             KeyFlush -- Flush Keyboard
  2700.             KeyFlush -- Flush Keyboard
  2701.             
  2702.             KeyFlush flushes all pending characters from the keyboard.
  2703.             KeyFlush                                                  
  2704.             
  2705.             
  2706.             KeySend -- Send Function Key Value To Remote
  2707.             KeySend -- Send Function Key Value To Remote
  2708.             
  2709.             KeySend sends  the specified  key's definition to the remote
  2710.             KeySend                                                     
  2711.             system.  The syntax is:
  2712.             
  2713.                  KeySend Skeyname
  2714.             
  2715.             Skeyname provides  the name  of the  key to  be sent.    The
  2716.             Skeyname                                                    
  2717.             allowed values  for Skeyname  are the same as for the KeyDef
  2718.                                 Skeyname                          KeyDef
  2719.             command above.
  2720.             
  2721.             Example:
  2722.             
  2723.                  *           Send the text associated with function key F1
  2724.                  *           to the remote system
  2725.                  *
  2726.                  KeySend "F1"
  2727.             
  2728.  
  2729.  
  2730.             PibTerm Script Language Reference Guide              Page 38
  2731.             PibTerm Script Language Reference Guide              Page 38
  2732.  
  2733.  
  2734.             
  2735.             Log -- Toggle Printer Logging
  2736.             Log -- Toggle Printer Logging
  2737.             
  2738.             Log toggles  session logging  on printer,  like the keyboard
  2739.             Log                                                         
  2740.             entry <ALT>L.  You should ensure that your printer is turned
  2741.             on before  using <ALT>L.  When logging  is active,  all  the
  2742.             output from the remote system is echoed on your printer.
  2743.             
  2744.             
  2745.             Menu -- Display Pop-Up Menu
  2746.             Menu -- Display Pop-Up Menu
  2747.             
  2748.             Menu displays  a pop-up  menu on the screen similar to those
  2749.             Menu                                                        
  2750.             used internally by PibTerm.  The syntax is:
  2751.             
  2752.                  MENU Ires Irow Icol Ideflt Stitle Sitem1 Sitem2 ...
  2753.             
  2754.             Ires is  the index of the menu item chosen (or -1 if the ESC
  2755.             Ires                                                     ESC
  2756.             key it struck).
  2757.             
  2758.             Irow and Icol indicate the position to display the top left-
  2759.             Irow and Icol                                               
  2760.             hand corner  of the  position menu.   Irow  and Icol  may be
  2761.                                                   Irow      Icol        
  2762.             either integer variables or constants.
  2763.             
  2764.             Ideflt is  the index of the default choice and may be either
  2765.             Ideflt                                                      
  2766.             an integer variable or constant.
  2767.             
  2768.             Stitle is the menu title and may be either a string variable
  2769.             Stitle                                                      
  2770.             or constant.
  2771.             
  2772.             Sitem1, Sitem2,  etc. provide  the text  for the  menu  line
  2773.             Sitem1, Sitem2                                              
  2774.             entries and may be either string variables or constants.
  2775.             
  2776.             The resulting menu is displayed over the current contents of
  2777.             the screen. The keypad arrow keys/mouse/first character of a
  2778.             menu item  can be used to choose a value from the menu, just
  2779.             like with standard PibTerm menus.
  2780.             
  2781.             Example:
  2782.             
  2783.             Here is  a menu definition which requests that a pop-up menu
  2784.             with the  title "Select  baud rate"  be placed  at  position
  2785.             (column=10, row=11)  on the  screen.   There are to be three
  2786.             possible values,  300, 1200,  and  2400.    2400  is  to  be
  2787.             highlighted as the default value.
  2788.             
  2789.                  Declare MyBaud Integer
  2790.                  Menu MyBaud 10 11 3 "Select baud rate: " "300" "1200" "2400"
  2791.             
  2792.             If the  returned value  of MyBaud is 1, then 300 was chosen;
  2793.             if MyBaud  is 2,  then 1200  was chosen; if MyBaud is 3 then
  2794.             2400 was chosen.  If MyBaud is <= 0, then no choice was made
  2795.             (the ESC key was hit).
  2796.             
  2797.             
  2798.  
  2799.  
  2800.             PibTerm Script Language Reference Guide              Page 39
  2801.             PibTerm Script Language Reference Guide              Page 39
  2802.  
  2803.  
  2804.             Message -- Display Message On Screen
  2805.             Message -- Display Message On Screen
  2806.             
  2807.             Message displays text on the screen.  The syntax is:
  2808.             Message                                             
  2809.             
  2810.                  Message String
  2811.             
  2812.             where String  is the  text to  be displayed.   String may be
  2813.                   String                                   String       
  2814.             either a string variable or string constant.
  2815.             
  2816.             The text is NOT sent to the remote system.
  2817.             
  2818.             Example:
  2819.             
  2820.                  Message "Here is a sample message."
  2821.             
  2822.             The message  text cannot  span more than a single line.  You
  2823.             may enter as many 'Message' statements in a row as you want,
  2824.             if you wish to have more than one line of text appear.
  2825.             
  2826.             There is  an important difference in the function of Message
  2827.                                                                  Message
  2828.             and Writeln  0.   Message passes  the characters through the
  2829.                 Writeln  0    Message                                   
  2830.             current terminal  emulator display mechanism, so that escape
  2831.             sequences will  be processed.    This  allows  you  to  take
  2832.             advantage of  interesting effects possible when using escape
  2833.             sequences.   Writeln 0  writes the characters to the display
  2834.                          Writeln 0                                      
  2835.             directly,  without   regard  for   the  particular  terminal
  2836.             emulation  begin   used.    Escape  sequences  will  not  be
  2837.                                                                  not    
  2838.             processed.
  2839.             
  2840.             
  2841.             Mute -- Toggle Mute Mode
  2842.             Mute -- Toggle Mute Mode
  2843.             
  2844.             Mute toggles  mute mode, like the keyboard entry <ALT>M.  In
  2845.             Mute                                                        
  2846.             mute mode,  no sounds  like bells or music are issued.  This
  2847.             is ideal  for those late-night sessions when you want to log
  2848.             in to  those remote systems that play the entire top 40 rock
  2849.             hits before  they allow  you to do anything useful, and also
  2850.             for those  systems which  beep at  you  every  time  you  do
  2851.             ANYTHING at all.
  2852.             
  2853.             
  2854.             Open -- Open File
  2855.             Open -- Open File
  2856.             
  2857.             Open make a text file accessible for processing in a script.
  2858.             Open                                                        
  2859.             The syntax is:
  2860.             
  2861.                  Open Ifile Sname Stype
  2862.             
  2863.             Ifile is  the "handle"  (1 through 10) to be assigned to the
  2864.             Ifile                                                       
  2865.             file, and may be either an integer variable or constant.
  2866.             
  2867.             Sname is  the name of the file (which may include a complete
  2868.             Sname                                                       
  2869.             DOS path).
  2870.             
  2871.  
  2872.  
  2873.             PibTerm Script Language Reference Guide              Page 40
  2874.             PibTerm Script Language Reference Guide              Page 40
  2875.  
  2876.  
  2877.             Stype provides the access method for the file:
  2878.             Stype                                         
  2879.             
  2880.                  'I'  Input          File to be read
  2881.                  'O'  Output    File to written/overwritten
  2882.                  'A'  Append    File to be added to at end of file
  2883.             
  2884.             A file  opened  with  OPEN  should  be  closed  with  CLOSE.
  2885.                                   OPEN                            CLOSE 
  2886.             All opened  files are  automatically  closed  when  the  top
  2887.             script level  is exited.   Files  ARE global  across  nested
  2888.             scripts.
  2889.             
  2890.             A handle  of 0 is reserved for keyboard/screen input/output.
  2891.             You need not (and cannot) explicitly open handle 0.
  2892.             
  2893.             To read  from a  file, use  the  script  commands  Read  and
  2894.                                                                Read     
  2895.             Readln.  To write to a file, use Write and Writeln.  See the
  2896.             Readln                           Write     Writeln          
  2897.             definitions of  those  commands  for  details.    To  switch
  2898.             between reading  and writing  a file,  you need to CLOSE the
  2899.                                                                CLOSE    
  2900.             file and re-open it.
  2901.             
  2902.             Examples:
  2903.             
  2904.                  *
  2905.                  Declare handle   integer
  2906.                  Declare filename string
  2907.                  Declare opentype string
  2908.                  *
  2909.                  Open 1 'bogus.txt' 'input'
  2910.                  *
  2911.                  Set handle = 2
  2912.                  Set filename = 'c:\mybogus\bogus2.txt'
  2913.                  Set opentype = 'output'
  2914.                  *
  2915.                  Open handle filename opentype
  2916.                  
  2917.             
  2918.             Param -- Set Program Parameter
  2919.             Param -- Set Program Parameter
  2920.             
  2921.             Param sets  Pibterm program  parameters.  The syntax follows
  2922.             Param                                                       
  2923.             that used  in the  PIBTERM.CNF file.   You  specify the two-
  2924.             letter name  of the parameter to change, then an equal sign,
  2925.             and then  the value  to be  assigned to that parameter.  The
  2926.             parameter names  and values  are described  in the  "PibTerm
  2927.             Parameters Reference Guide."
  2928.             
  2929.             Param is  an old  script command,  left over  from  previous
  2930.             Param                                                       
  2931.             PibTerm versions,  and  included  for  compatibility.    You
  2932.             should use the SetParam command instead in new scripts.
  2933.                            SetParam                                
  2934.             
  2935.             For example, to change the terminal emulation to VT100 mode,
  2936.             write:
  2937.             
  2938.                  Param te=3
  2939.             
  2940.  
  2941.  
  2942.             PibTerm Script Language Reference Guide              Page 41
  2943.             PibTerm Script Language Reference Guide              Page 41
  2944.  
  2945.  
  2946.             To change the baud rate to 1200 baud, write:
  2947.             
  2948.                  Param ba=1200
  2949.             
  2950.             
  2951.             PrintFile -- Print A File
  2952.             PrintFile -- Print A File
  2953.             
  2954.             PrintFile starts  printing a specified file using the built-
  2955.             PrintFile                                                   
  2956.             in PibTerm  print spooler.   PibTerm   overlaps the printing
  2957.             with other  duties like reading keyboard input or displaying
  2958.             output received from the remote system.
  2959.             
  2960.             The syntax for PrintFile is:
  2961.             
  2962.                  PrintFile Sname
  2963.             
  2964.             Sname specifies the name of the file to be printed.
  2965.             Sname                                              
  2966.             
  2967.             To start printing a file called "BOGUSCO.LIS", write:
  2968.             
  2969.                  PrintFile "Bogusco.lis"
  2970.             
  2971.             To  stop  the  print  operation  before  the  file  finishes
  2972.             printing, write:
  2973.             
  2974.                  PrintFile ""
  2975.             
  2976.             
  2977.             Procedure -- Define Script Procedure
  2978.             Procedure -- Define Script Procedure
  2979.             
  2980.             Procedure marks the start of an internal script procedure. A
  2981.             Procedure                                                   
  2982.             script procedure  is like  a script within a script. You can
  2983.             declare an internal script procedure as follows:
  2984.             
  2985.                  PROCEDURE name args
  2986.                       -- statements ---
  2987.                  ENDPROC
  2988.             
  2989.             Here name  is the  name of the procedure, and args is a list
  2990.                  name                                     args          
  2991.             of arguments  and types  for the procedure.  A procedure may
  2992.             reference any  variables previously  defined by higher level
  2993.             procedures or  the main  script as  well  as  the  variables
  2994.             defined by its arguments. Local variables -- declared within
  2995.             the procedure -- are also allowed.
  2996.             
  2997.             A procedure definition must precede its first use.
  2998.             
  2999.             The EndProc  acts as  a return.  You may also explicitly use
  3000.                 EndProc                                                 
  3001.             the Return statement.
  3002.                 Return           
  3003.             
  3004.             You invoke a procedure using the CALL statement:
  3005.                                              CALL           
  3006.             
  3007.                  Call name arguments
  3008.             
  3009.  
  3010.  
  3011.             PibTerm Script Language Reference Guide              Page 42
  3012.             PibTerm Script Language Reference Guide              Page 42
  3013.  
  3014.  
  3015.             Here name  is the  name of  the procedure, and arguments are
  3016.                  name                                      arguments    
  3017.             the procedure  arguments.   The arguments must match in type
  3018.             and number  with those  declared on  the  PROCEDURE  command
  3019.                                                       PROCEDURE         
  3020.             defining the  called procedure.  (If not,  a syntax error is
  3021.             reported.)  The arguments may be variables or constants, but
  3022.             NOT expressions.     Arguments which  ARE variables  may  be
  3023.             changed in  the called procedures if desired. Constants will
  3024.             NOT be  changed, even  if an assignment to the corresponding
  3025.             procedure argument is made in the body of the procedure.
  3026.             
  3027.             IT IS  EXTREMELY IMPORTANT  TO DECLARE  ALL GLOBAL VARIABLES
  3028.             IT IS  EXTREMELY IMPORTANT  TO DECLARE  ALL GLOBAL VARIABLES
  3029.             BEFORE  DEFINING   ANY  PROCEDURES,   whether  or   not  the
  3030.             BEFORE  DEFINING   ANY  PROCEDURES,                         
  3031.             procedures use variables. Likewise, all IMPORTs must precede
  3032.             any procedure definitions.
  3033.             
  3034.             Here is  a sample  script with  two procedures,  neither  of
  3035.             which takes an argument:
  3036.             
  3037.                  *
  3038.                  *   Here is the first procedure.
  3039.                  *
  3040.                  PROCEDURE One
  3041.                     Message " "
  3042.                     Message "Script ONE was called."
  3043.                     Message " "
  3044.                  ENDPROC
  3045.                  *
  3046.                  *   Here is the second procedure.
  3047.                  *
  3048.                  PROCEDURE Two
  3049.                     Message " "
  3050.                     Message "Script TWO was called."
  3051.                     Message " "
  3052.                  ENDPROC
  3053.                  *
  3054.                  *   Begin "mainline" script.  This is where script execution
  3055.                  *   actually begins.
  3056.                  *
  3057.                  Call One
  3058.                  Call Two
  3059.                  
  3060.             Here is  a sample script with procedures with sub-procedures
  3061.             and arguments:
  3062.             
  3063.                  Declare A String
  3064.                  Declare B Integer
  3065.                  Declare S String
  3066.                  *
  3067.                  PROCEDURE Sub1 Mya String, MyB Integer
  3068.                  *
  3069.                  Declare MyC String
  3070.                  *
  3071.                     PROCEDURE Sub1a Mya String
  3072.                        Message "Entered procedure Sub1a"
  3073.  
  3074.  
  3075.             PibTerm Script Language Reference Guide              Page 43
  3076.             PibTerm Script Language Reference Guide              Page 43
  3077.  
  3078.  
  3079.                        Set MyC = CONCAT( CONCAT( 'Value of A = <', MyA ), '>' )
  3080.                        Message MyC
  3081.                        Set MyA = 'BOGUS A!!!!!'
  3082.                     ENDPROC
  3083.                  *
  3084.                     PROCEDURE Sub2a MyB Integer
  3085.                        Set MyC = CONCAT( 'Value of B = ', String( MyB ) )
  3086.                        Message MyC
  3087.                     ENDPROC
  3088.                  *
  3089.                     Call Sub1a Mya
  3090.                     Call Sub2a Myb
  3091.                  *
  3092.                  *
  3093.                  ENDPROC
  3094.                  *
  3095.                  PROCEDURE Sub2 MyB Integer
  3096.                  *
  3097.                     Declare MyC String
  3098.                  *
  3099.                     Message "Entered script Sub2"
  3100.                     Set MyC = CONCAT( 'Value of B = ', String( MyB ) )
  3101.                     Message MyC
  3102.                  *
  3103.                     Set MyB = 10
  3104.                  *
  3105.                  ENDPROC
  3106.                  *
  3107.                  PROCEDURE Sub3 MyA String
  3108.                  *
  3109.                     Declare MyC String
  3110.                  *
  3111.                     Message "Entered script Sub3"
  3112.                     Set MyC = CONCAT( CONCAT( 'Value of A = <', MyA ), '>' )
  3113.                     Message MyC
  3114.                  *
  3115.                  ENDPROC
  3116.                  *==============================================================
  3117.                  *                   M A I N   P R O G R A M                   *
  3118.                  *==============================================================
  3119.                  *
  3120.                  Set A = 'Here is parameter A'
  3121.                  Set B = 50
  3122.                  *
  3123.                  Set S = CONCAT( CONCAT( 'A:<' , A ), '>' )
  3124.                  Message S
  3125.                  *
  3126.                  Set S = CONCAT( CONCAT( 'B:<' , STRING( B ) ), '>' )
  3127.                  Message S
  3128.                  *
  3129.                  Message A
  3130.                  Message "Calling procedure Sub1 ..."
  3131.                  *
  3132.                  Call sub1 A B
  3133.  
  3134.  
  3135.             PibTerm Script Language Reference Guide              Page 44
  3136.             PibTerm Script Language Reference Guide              Page 44
  3137.  
  3138.  
  3139.                  *
  3140.                  Message "Back to main"
  3141.                  Set S = CONCAT( CONCAT( 'New value of A is <', A ), '>' )
  3142.                  Message S
  3143.                  *
  3144.                  Message "Calling procedure Sub2 ..."
  3145.                  *
  3146.                  Call sub2 B
  3147.                  *
  3148.                  Message "Back to main"
  3149.                  Set S = CONCAT( 'New value of B is ', String( B ) )
  3150.                  Message S
  3151.                  *
  3152.                  Message "Calling procedure Sub3 ..."
  3153.                  *
  3154.                  Call sub3 A
  3155.                  *
  3156.                  Message "Back to main"
  3157.                  
  3158.             
  3159.             Procedure Sub1a  above changes  the value  of MyA,  which in
  3160.                       Sub1a                               MyA           
  3161.             turn changes  the value  of variable  A in  the main  script
  3162.                                                   A                     
  3163.             body.  What if the call to Sub1 had been
  3164.                                        Sub1         
  3165.             
  3166.                  Call sub1 'Hi there!' B
  3167.             
  3168.             instead?  Would the value of 'Hi there!' somehow be changed?
  3169.             
  3170.             No, PibTerm  recognizes that  a request to change a constant
  3171.             has been  made and IGNORES it.  The change WILL be in effect
  3172.             during the  lifetime of Sub1/Sub1a, but the changed value is
  3173.             NOT passed back to the main script body.
  3174.             
  3175.             
  3176.             Quit -- Quit PibTerm execution
  3177.             Quit -- Quit PibTerm execution
  3178.             
  3179.             
  3180.             Quit terminates  execution of  PibTerm and  returns to  DOS.
  3181.             Quit                                                        
  3182.             The effect  of Quit is similar to typing <ALT>X, except that
  3183.                            Quit                                         
  3184.             all current  scripts are  exited, and  no prompt  is  issued
  3185.             asking if execution should actually be terminated.
  3186.             
  3187.             Quit is  useful in writing scripts for unattended operation,
  3188.             Quit                                                        
  3189.             so that  PibTerm can  be invoked  as one  command in a batch
  3190.             file, and  then the batch file can continue after PibTerm is
  3191.             exited.
  3192.             
  3193.             
  3194.             Read -- Read Characters From A File
  3195.             Read -- Read Characters From A File
  3196.             
  3197.             Read reads characters from a file which has been opened with
  3198.             Read                                                        
  3199.             the Open script command.  The syntax is:
  3200.                 Open                                
  3201.             
  3202.                  READ Ifile Sdata Ichars
  3203.  
  3204.  
  3205.             PibTerm Script Language Reference Guide              Page 45
  3206.             PibTerm Script Language Reference Guide              Page 45
  3207.  
  3208.  
  3209.             
  3210.             Ifile is the file handle for the file from the Open command.
  3211.             Ifile                                                       
  3212.             Ichars provides the number of characters to be read.
  3213.             Ichars                                              
  3214.             Sdata is the string of characters as read from the file.
  3215.             Sdata                                                   
  3216.             
  3217.             Both Ifile  and Ichars can be integer variables.  Sdata must
  3218.                  Ifile      Ichars                            Sdata     
  3219.             be a string variable.
  3220.             
  3221.             The file  must have  been opened  for input;  see  the  Open
  3222.                                                                     Open
  3223.             command for details.
  3224.             
  3225.             You can  specify file  handle 0  -- or  omit the file handle
  3226.             altogether -- to read from the keyboard.
  3227.             
  3228.             You can test for end-of-file using the EOF function (see the
  3229.                                                    EOF                  
  3230.             description  in  the  Set  command).  End-of-file  is  never
  3231.                                   Set                                   
  3232.             returned for the keyboard.
  3233.             
  3234.             You can test for an I/O error using the IOResult function
  3235.                                                     IOResult         
  3236.             (see the Set command for details).
  3237.                      Set                      
  3238.             
  3239.             
  3240.             Example:
  3241.             
  3242.                  Declare mychars string
  3243.                  *                         Open the file
  3244.                  Open 1 "myfile.dat" "I"
  3245.                  *                         Read ten characters from file
  3246.                  READ 1 mychars 10
  3247.                  *                         Check for an error
  3248.                  *
  3249.                  IF ( IOResult <> 0 ) THEN
  3250.                     Message "I/O error reading handle 1"
  3251.                  ENDIF
  3252.             
  3253.             Another example:
  3254.             
  3255.             Suppose you want to read one character from the keyboard
  3256.             without requiring that a carriage return be entered
  3257.             afterwards.  That can be done by writing a read statement
  3258.             for one character as follows:
  3259.             
  3260.                  *
  3261.                  Declare Ch String
  3262.                  *
  3263.                  Read Ch 1
  3264.             
  3265.             
  3266.             Readln -- Read Line From File
  3267.             Readln -- Read Line From File
  3268.             
  3269.             Readln reads  a line  of text  from a file previously opened
  3270.             Readln                                                      
  3271.             using the Open script command. The syntax is:
  3272.                       Open                               
  3273.             
  3274.                  READLN Ifile Sdata
  3275.  
  3276.  
  3277.             PibTerm Script Language Reference Guide              Page 46
  3278.             PibTerm Script Language Reference Guide              Page 46
  3279.  
  3280.  
  3281.             
  3282.             Ifile is the file handle to read from.
  3283.             Ifile                                 
  3284.             Sdata stores  the characters read from the file, and must be
  3285.             Sdata                                                       
  3286.             a string  variable. If  no characters  are  read,  Sdata  is
  3287.                                                                Sdata    
  3288.             returned as an empty string.
  3289.             
  3290.             A line  is defined  as a  series of  up to to 255 character,
  3291.             terminated by  Ascii characters  ^M^J (carriage  return  and
  3292.             line feed).   The terminating ^M^J characters are not stored
  3293.             as part of the string S1.
  3294.             
  3295.             The file  must have  been opened  for input;  see  the  Open
  3296.             command for details.
  3297.             
  3298.             You can  specify file  handle 0  -- or  omit the file handle
  3299.             altogether -- to read from the keyboard.
  3300.             
  3301.             You can test for end-of-file using the EOF function (see the
  3302.                                                    EOF                  
  3303.             description  in  the  Set  command).  End-of-file  is  never
  3304.                                   Set                                   
  3305.             returned for the keyboard.
  3306.             
  3307.             You can  test for  an I/O  error using the IOResult function
  3308.                                                        IOResult         
  3309.             (see the Set command for details).
  3310.                      Set                      
  3311.             
  3312.             Example:
  3313.             
  3314.             
  3315.                  Declare mychars string
  3316.                  *                         Open the file
  3317.                  Open 1 "myfile.dat" "I"
  3318.                  *                         Read line from file
  3319.                  READLN 1 mychars
  3320.                  *                         Check for an error
  3321.                  *
  3322.                  IF ( IOResult <> 0 ) THEN
  3323.                     Message "I/O error reading handle 1"
  3324.                  ENDIF
  3325.             
  3326.             
  3327.             Receive -- Receive File From Remote System
  3328.             Receive -- Receive File From Remote System
  3329.             
  3330.             Receive is used to receive a file from a remote system, like
  3331.             Receive                                                     
  3332.             the keyboard command <ALT>R.  The syntax is:
  3333.             
  3334.                  Receive Sname Sprotocol
  3335.             
  3336.             Sname is  the name  of the  file to  be received.    It  may
  3337.             Sname                                                       
  3338.             contain a wildcard specification for batch protocols.
  3339.             
  3340.             Sprotocol contains the abbreviation for the protocol name to
  3341.             Sprotocol                                                   
  3342.             be used for the transfer.
  3343.             
  3344.             The protocol names are:
  3345.             
  3346.  
  3347.  
  3348.             PibTerm Script Language Reference Guide              Page 47
  3349.             PibTerm Script Language Reference Guide              Page 47
  3350.  
  3351.  
  3352.                  AS   --   Ascii
  3353.                  XK   --   Xmodem CheckSum
  3354.                  XC   --   Xmodem CRC
  3355.                  X1   --   Xmodem 1K
  3356.                  XG   --   Xmodem 1K G
  3357.                  YB   --   Ymodem Batch
  3358.                  YG   --   Ymodem G Batch
  3359.                  TE   --   Telink
  3360.                  MK   --   Modem7 Batch Checksum
  3361.                  M7   --   Modem7 Batch CRC
  3362.                  KE   --   Kermit
  3363.             
  3364.             If you  have added  any user-defined  protocols, then  their
  3365.             abbreviations  can   also  be   used.     For  example,  you
  3366.             customarily use ZM as an abbreviation for Zmodem.
  3367.                             ZM                               
  3368.             
  3369.             To receive the file YUMYUM.PAS using Xmodem 1K, write:
  3370.             
  3371.                  Receive "yumyum.pas" "X1"
  3372.             
  3373.             To receive a batch of files using Ymodem, write:
  3374.             
  3375.                  Receive "" "YB"
  3376.             
  3377.             The file names are automatically provided by the sender with
  3378.             Ymodem, so  you don't  have to  specify  the  name  --  just
  3379.             provide a  null filename  as shown above.  This is generally
  3380.             true of other batch protocols as well.
  3381.             
  3382.             Note that  "Receive" only  sets up PibTerm to receive a file
  3383.             - it  does NOT  initiate a  transfer from the remote system.
  3384.             You will need to issue a command to the remote system to get
  3385.             it to  start a  transfer so  that Pibterm  can  receive  the
  3386.             file(s).   For example,  if you  are connected  to the  file
  3387.             section of  an RBBS  system, you  might enter  the following
  3388.             sequence of statements to download a file you know you want:
  3389.             
  3390.                  *
  3391.                  *     Request that file "goodstuf.lbr" be sent to me.
  3392.                  *
  3393.                  Stext "s;goodstuf.lbr;x|"
  3394.                  Receive "goodstuf.lbr" x
  3395.                  
  3396.             
  3397.             There  are   a  number  of  remote  Kermit  server  commands
  3398.             implemented, available  from the  Kermit receive  file menu.
  3399.             You can  also indicate that you want a remote server command
  3400.             in a  script, by  requesting a Kermit download and using '/'
  3401.             followed by the text of the remote server command.
  3402.             
  3403.             Examples:
  3404.             
  3405.                  *
  3406.                  *                          Send FINISH command to server
  3407.  
  3408.  
  3409.             PibTerm Script Language Reference Guide              Page 48
  3410.             PibTerm Script Language Reference Guide              Page 48
  3411.  
  3412.  
  3413.                  *
  3414.                  Receive '/FINISH'    "Ke"
  3415.                  *
  3416.                  *                          Send "display directory" command
  3417.                  *
  3418.                  Receive '/DIRECTORY' "Ke"
  3419.                  *
  3420.                  *                          Send "type file BOGUS" command
  3421.                  *
  3422.                  Receive '/TYPE BOGUS' "Ke"
  3423.                  *
  3424.                  *                          Send "change directory" command
  3425.                  *
  3426.                  Receive '/CWD Sys$login' "Ke"
  3427.             
  3428.             It may  seem backwards to use RECEIVE rather than SEND here,
  3429.             but it  turns out to be more convenient, since the output of
  3430.             these commands  is sent  to PibTerm as file (to be displayed
  3431.             on the screen) using the Kermit protocol.
  3432.             
  3433.             
  3434.             Redial -- Redial Last Number Dialed
  3435.             Redial -- Redial Last Number Dialed
  3436.             
  3437.             Redial redials  the last  phone  number  entered,  like  the
  3438.             Redial                                                      
  3439.             keyboard command  <ALT>Q.   However, you can specify a phone
  3440.             number in  quotes on  the 'Redial'  command and PibTerm will
  3441.             redial that  phone number until a connection is established.
  3442.             For example,  to repeatedly  dial phone  directory  entry  3
  3443.             until a connection is established, write:
  3444.             
  3445.                Redial "3"
  3446.             
  3447.             
  3448.             Repeat -- Repeat Block Of Statements
  3449.             Repeat -- Repeat Block Of Statements
  3450.             
  3451.             Repeat  begins  a  block  of  statements  to  be  repeatedly
  3452.             Repeat                                                      
  3453.             executed until  the condition  on a matching UNTIL statement
  3454.             is true.
  3455.             
  3456.             Examples:
  3457.             
  3458.             Here is  a loop  which sends a carriage return to the remote
  3459.             system once every two seconds and looks to see if the string
  3460.             "Username:" has arrived.  The loop exits when "Username:" is
  3461.             found.
  3462.                  
  3463.                  Repeat
  3464.                     Stext '|'
  3465.                     Waitstring "Username:" 2
  3466.                  Until ( WaitFound )
  3467.             
  3468.             
  3469.             Here is a "repeat forever" loop that will never complete:
  3470.             
  3471.  
  3472.  
  3473.             PibTerm Script Language Reference Guide              Page 49
  3474.             PibTerm Script Language Reference Guide              Page 49
  3475.  
  3476.  
  3477.                  Repeat
  3478.                       .    
  3479.                       .
  3480.                  Until ( 0 )
  3481.                                           
  3482.             You can  stop such  a loop  from  the  keyboard  by  hitting
  3483.             <ALT>X, or  by using the Exit/ExitAll script commands inside
  3484.                                      Exit/ExitAll                       
  3485.             the Repeat/Until loop.
  3486.             
  3487.             Other testable  conditions  are  described  under  the  "If"
  3488.             statement above.
  3489.             
  3490.             
  3491.             Reset -- Reset Script Execute To Start Of Script
  3492.             Reset -- Reset Script Execute To Start Of Script
  3493.             
  3494.             Reset starts executing the current script from the beginning
  3495.             Reset                                                       
  3496.             of the script again.  Reset has no arguments.
  3497.             
  3498.             
  3499.             RInput -- Receive Input From Remote System
  3500.             RInput -- Receive Input From Remote System
  3501.             
  3502.             RInput prompts for input from the remote system.  The syntax
  3503.             RInput                                                      
  3504.             is:
  3505.             
  3506.                  RInput Sprompt Secho Sanswer
  3507.             
  3508.             Sprompt is  the prompt  string, which  will be  sent to  the
  3509.             Sprompt                                                     
  3510.             remote  system   as  an   indication  that  input  is  being
  3511.             requested.  The prompt string can be empty, in which case no
  3512.             prompt to the remote system will be issued.
  3513.             
  3514.             Secho indicates  if the  remote system's response characters
  3515.             Secho                                                       
  3516.             are to  be echoed by the actual character value or a '.' for
  3517.             security purposes.
  3518.             
  3519.             Sanswer is  the response from the remote system, and must be
  3520.             Sanswer                                                     
  3521.             specified as a string variable.
  3522.             
  3523.             Setting Sechor  = 'Echo'  causes the actual character values
  3524.                     Sechor                                              
  3525.             received from the remote system to be echoed.  Setting Secho
  3526.                                                                    Secho
  3527.             = 'Noecho'  causes '.'  to be  used to  echo each character.
  3528.             This is useful when echoing passwords.
  3529.             
  3530.             Examples:
  3531.             
  3532.  
  3533.  
  3534.             PibTerm Script Language Reference Guide              Page 50
  3535.             PibTerm Script Language Reference Guide              Page 50
  3536.  
  3537.  
  3538.                  *                 Read response from remote system into
  3539.                  *                 variable, echoing the characters as
  3540.                  *                 sent.
  3541.                  
  3542.                  Declare Response String
  3543.                  Declare Prompt   String
  3544.                  Declare Echo     String
  3545.                  *
  3546.                  RInput 'Enter letter: ' 'ECHO' Response
  3547.                  *
  3548.                  *                 Now read response and echo using '.'s.
  3549.                  *
  3550.                  Set Prompt = 'Enter letter: '
  3551.                  Set Echo   = 'NOECHO'
  3552.                  RInput Prompt Echo Response
  3553.             
  3554.             
  3555.             ScreenDump -- Dump Screen To File
  3556.             ScreenDump -- Dump Screen To File
  3557.             
  3558.             ScreenDump writes the current screen contents (text only) to
  3559.             ScreenDump                                                  
  3560.             a file, like the <ALT>U keyboard command.  The syntax is:
  3561.             
  3562.                  SCREENDUMP Sname
  3563.             
  3564.             Sname contains the file name to receive the screen dump.
  3565.             Sname                                                   
  3566.             
  3567.             Examples:
  3568.             
  3569.                  Declare DumpFile String
  3570.                  ScreenDump 'bozo.dat'
  3571.                  Set DumpFile = 'bozo.dat'
  3572.                  ScreenDump DumpFile
  3573.             
  3574.             
  3575.             Send -- Send File To Remote System
  3576.             Send -- Send File To Remote System
  3577.             
  3578.             Send sends  a file  to a  remote system,  like the  keyboard
  3579.             Send                                                        
  3580.             command <ALT>S.  The syntax is:
  3581.             
  3582.                  Send Sname Sprotocol
  3583.             
  3584.             Sname is  the name  of the  file to  be sent,  and can  be a
  3585.             Sname                                                       
  3586.             wildcard specification for batch protocol transfers.
  3587.             
  3588.             Sprotocol is  the protocol  abbreviation.   (See the Receive
  3589.             Sprotocol                                            Receive
  3590.             command for a list of protocol abbreviations.)
  3591.             
  3592.             For example,  to send  the file  "yumyum.lbr"  to  a  remote
  3593.             system using Xmodem-CRC, write:
  3594.             
  3595.                  Send "yumyum.lbr" "xc"
  3596.             
  3597.             To send  all files  ending in  .PAS using Telink to a remote
  3598.             system, write:
  3599.  
  3600.  
  3601.             PibTerm Script Language Reference Guide              Page 51
  3602.             PibTerm Script Language Reference Guide              Page 51
  3603.  
  3604.  
  3605.             
  3606.                  Send "*.pas" "te"
  3607.             
  3608.             'Send' only  causes PibTerm  to begin  sending files  to the
  3609.             remote system.   You  must have  previously  instructed  the
  3610.             remote system  to be  ready  to  receive  the  files.    For
  3611.             example, if you are connected to the file section of an RBBS
  3612.             system, you  could send  the file  "yumyum.lbr" using Xmodem
  3613.             with the commands:
  3614.             
  3615.                  SText "r;yumyum.lbr;x|"
  3616.                  Suspend 400
  3617.                  Send "yumyum.lbr" "x"
  3618.             
  3619.             The Suspend  is included  to ensure  we don't start the send
  3620.                 Suspend                                                 
  3621.             procedure before RBBS is ready.
  3622.             
  3623.             Kermit transfers  are particularly easy if the remote system
  3624.             can run  Kermit in  server mode.   Just  run Kermit  on  the
  3625.             remote system,  put it  into server  mode,  and  issue  Send
  3626.             commands to  your heart's  content.   For example, to send a
  3627.             bunch of files to a Vax system running Kermit under VMS, you
  3628.             could write:
  3629.             
  3630.                  *
  3631.                  *     Wait for VMS command prompt
  3632.                  *
  3633.                   WaitString "$"
  3634.                  *
  3635.                  *     Start up Kermit
  3636.                  *
  3637.                   SText "Kermit|"
  3638.                  *
  3639.                  *     Wait for Kermit's prompt, then send command
  3640.                  *     to put Kermit in server mode.
  3641.                  *
  3642.                   Waitstring ">"
  3643.                   SText "Server|"
  3644.                  *
  3645.                  *     Wait for blurb about server mode to go by, then
  3646.                  *     send a bunch of files, then receive a file.
  3647.                  *
  3648.                   Suspend 500
  3649.                   Send "*.pas" "ke"
  3650.                   Send "*.doc" "ke"
  3651.                  *
  3652.                   Receive "newstuf.doc" "ke"
  3653.                  *
  3654.                  *     Take remote Kermit out of server mode.
  3655.                  *
  3656.                   Receive "/finish" "ke"
  3657.                  *
  3658.                  *     Tell remote Kermit to stop executing.
  3659.                  *
  3660.  
  3661.  
  3662.             PibTerm Script Language Reference Guide              Page 52
  3663.             PibTerm Script Language Reference Guide              Page 52
  3664.  
  3665.  
  3666.                   SText "exit|"
  3667.                  
  3668.             
  3669.             
  3670.             Set -- Assign Value To Script Variable
  3671.             Set -- Assign Value To Script Variable
  3672.             
  3673.             The Set  command may  be used  to assign  values  to  script
  3674.                 Set                                                     
  3675.             variables. The Set command has the form:
  3676.             
  3677.                  Set varname = expression
  3678.             
  3679.             where 'varname'  is the  name of the variable to be set, and
  3680.             'expression' is the value.
  3681.             
  3682.             You may  omit Set  if you  like, since  a script line of the
  3683.                           Set                                           
  3684.             form
  3685.                  
  3686.                  varname = expression
  3687.             
  3688.             is assumed to be a Set statement.
  3689.                                Set           
  3690.             
  3691.             The allowable expressions are:
  3692.             
  3693.             1.   a string  constant enclosed  in  quotes  for  a  string
  3694.                  variable, e.g.,
  3695.             
  3696.                       SET Abc = 'Here''s a string'
  3697.             
  3698.             2.   an integer constant for an integer variable, e.g.,
  3699.             
  3700.                       SET c = 123
  3701.             
  3702.             3.   another variable
  3703.             
  3704.                       SET Abc = Yum
  3705.             
  3706.             4.   a special function, which may be one of the following:
  3707.             
  3708.                  ATTENDED            returns a value of 1 if the session
  3709.                  ATTENDED                                               
  3710.                                      is in  attended mode (AM=1) or 0 if
  3711.                                      the session  is in  unattended mode
  3712.                                      (AM=0).
  3713.                  
  3714.                  CHR( n )            returns   a    1-character   string
  3715.                  CHR( n )                                               
  3716.                                      containing  the   Ascii   character
  3717.                                      whose ordinal is given by 'n'.  For
  3718.                                      example, CHR(65)  = 'A'.  If 'n' is
  3719.                                      not in  the range  0  through  255,
  3720.                                      then a null string is returned.
  3721.                  
  3722.                  CONCAT( s1 , s2 )   concatenates strings 's1' and 's2'.
  3723.                  CONCAT( s1 , s2 )                                      
  3724.                  
  3725.  
  3726.  
  3727.             PibTerm Script Language Reference Guide              Page 53
  3728.             PibTerm Script Language Reference Guide              Page 53
  3729.  
  3730.  
  3731.                  CONNECTED           returns a  value of  1 if  a remote
  3732.                  CONNECTED                                              
  3733.                                      connection has  been made or 0 if a
  3734.                                      remote connection doesn't exist.
  3735.                  
  3736.                  DUPL( S1, n )       returns string with first character
  3737.                  DUPL( S1, n )                                          
  3738.                                      in S1 duplicated n times.
  3739.                  
  3740.                  DATE                returns  date   as  a   string   in
  3741.                  DATE                                                   
  3742.                                      YY/MM/DD format.
  3743.                  
  3744.                  DIALED              returns the dialing entry number if
  3745.                  DIALED                                                 
  3746.                                      this script was executed because it
  3747.                                      was attached to a dialing directory
  3748.                                      entry, or 0 (or -1) otherwise.
  3749.                  
  3750.                  DIALENTRY( n )      returns the  n-th dialing directory
  3751.                  DIALENTRY( n )                                         
  3752.                                      entry as a string.  This string can
  3753.                                      be  broken  up  into  fields  using
  3754.                                      other string  functions. The format
  3755.                                      of   the   dialing   directory   is
  3756.                                      described in  the PibTerm parameter
  3757.                                      reference guide.    If  an  invalid
  3758.                                      entry  number   is  given,  a  null
  3759.                                      string is returned.
  3760.                  
  3761.                  ENHKEYBD            returns 1  if an  enhanced  101-key
  3762.                  ENHKEYBD                                               
  3763.                                      keyboard is in use, 0 otherwise.
  3764.                  
  3765.                  EOF( I1 )           returns  1   if  file  attached  to
  3766.                  EOF( I1 )                                              
  3767.                                      handle specified by I1 is at end of
  3768.                                      file,  0   otherwise.     (See  the
  3769.                                      description  below   of  the   OPEN
  3770.                                      script command for details.)
  3771.                  
  3772.                  FILEEXISTS( S1 )    returns a  value of  1 if  the file
  3773.                  FILEEXISTS( S1 )                                       
  3774.                                      named in  'S1' exists, or '0' if it
  3775.                                      doesn't exist.
  3776.                  
  3777.                  INDEX( s1 , s2 )    position of  string 's1'  in string
  3778.                  INDEX( s1 , s2 )                                       
  3779.                                      's2' or zero if not found
  3780.                  
  3781.                  IORESULT            returns system  code from  last I/O
  3782.                  IORESULT                                               
  3783.                                      operation.       Should   be   used
  3784.                                      following READ,  WRITE, OPEN,  etc.
  3785.                                      commands to check whether operation
  3786.                                      proceeded properly.  0 always means
  3787.                                      operation completely successfully.
  3788.                  
  3789.                  KEYSTRING( s )      returns  the  function  key  string
  3790.                  KEYSTRING( s )                                         
  3791.                                      attached to  the key name specified
  3792.                                      by the  value  of  "s".    See  the
  3793.                                      description of  the  KeyDef  script
  3794.                                      command for legitimate names to use
  3795.                                      in "s".
  3796.  
  3797.  
  3798.             PibTerm Script Language Reference Guide              Page 54
  3799.             PibTerm Script Language Reference Guide              Page 54
  3800.  
  3801.  
  3802.                  
  3803.                  LENGTH( s )         current length  of string  variable
  3804.                  LENGTH( s )                                            
  3805.                                      's'.
  3806.                  
  3807.                  LTRIM( S1 )         trims leading  blanks  from  string
  3808.                  LTRIM( S1 )                                            
  3809.                                      S1.
  3810.                  
  3811.                  NUMBER( s1 , n )    if  's1'   can  be   converted   to
  3812.                  NUMBER( s1 , n )                                       
  3813.                                      integer, then  the  integer  value,
  3814.                                      else zero.   If  the conversion was
  3815.                                      done,  N   is  0,  else  N  is  the
  3816.                                      character position  in  's1'  which
  3817.                                      caused the conversion to fail.
  3818.                  
  3819.                  ORD( s1, n )        returns the  Ascii ordinal  of  the
  3820.                  ORD( s1, n )                                           
  3821.                                      nth character  in  the  string  s1.
  3822.                                      For example,  ORD( 'A', 1 ) returns
  3823.                                      65.   If 'n'  is  less  than  1  or
  3824.                                      greater than  the length of 's1', 0
  3825.                                      is returned.
  3826.                  
  3827.                  PARAMLINE           returns  current   parameter   line
  3828.                  PARAMLINE                                              
  3829.                                      contents (for  use  when  executing
  3830.                                      script tied to added user command).
  3831.                  
  3832.                  PARAMCOUNT          returns number  of  blank-delimited
  3833.                  PARAMCOUNT                                             
  3834.                                      parameters  appearing   in  current
  3835.                                      parameter   line   (as   given   by
  3836.                                      PARAMLINE).
  3837.                  
  3838.                  PARAMSTR( I1 )      returns I1-th  parameter in current
  3839.                  PARAMSTR( I1 )                                         
  3840.                                      parameter   line   (as   given   by
  3841.                                      PARAMLINE).
  3842.                  
  3843.                  READCTRL( s1 )      reads  a   string  containing   the
  3844.                  READCTRL( s1 )                                         
  3845.                                      special control  character  markers
  3846.                                      used for  function key definitions,
  3847.                                      with each  instance of  the  marked
  3848.                                      characters  converted   to   actual
  3849.                                      control characters.   For  example,
  3850.                                      "ReadCtrl( ^C )" where "^C" are the
  3851.                                      two ascii  characters with ordinals
  3852.                                      94 and  67,  is  converted  to  the
  3853.                                      single control  character  ^C  with
  3854.                                                                 ^C      
  3855.                                      ascii ordinal 3.
  3856.                  
  3857.                  STRING( n )         value  of   integer   constant   or
  3858.                  STRING( n )                                            
  3859.                                      variable 'n' converted to string
  3860.                  
  3861.                  SUBSTR( s1, b, l )  substring of  's1' for  length 'l',
  3862.                  SUBSTR( s1, b, l )                                     
  3863.                                      starting at position 'n'.
  3864.                  
  3865.                  TIME                returns time  of day as a string in
  3866.                  TIME                                                   
  3867.                                      24 hour HH:MM:SS format.
  3868.  
  3869.  
  3870.             PibTerm Script Language Reference Guide              Page 55
  3871.             PibTerm Script Language Reference Guide              Page 55
  3872.  
  3873.  
  3874.                  
  3875.                  TRIM( S1 )          trims trailing  blanks from  string
  3876.                  TRIM( S1 )                                             
  3877.                                      S1.
  3878.                  
  3879.                  UPPERCASE( S1 )     returns  contents   of   S1   after
  3880.                  UPPERCASE( S1 )                                        
  3881.                                      converting  lower-case   to   upper
  3882.                                      case.
  3883.                  
  3884.                  WAITFOUND           returns 1  if preceding  WAITSTRING
  3885.                  WAITFOUND                                              
  3886.                                      or WAITLIST  was  successful,  else
  3887.                                      returns 0.
  3888.                  
  3889.                  WRITECTRL( s1 )     returns  a   string  in  which  any
  3890.                  WRITECTRL( s1 )                                        
  3891.                                      instances  in   's1'   of   control
  3892.                                      characters  are  converted  to  '^'
  3893.                                      prefix form, etc.
  3894.                  
  3895.             5.   A complex  expression containing  variables, constants,
  3896.                  operators, parentheses, and function calls.
  3897.             
  3898.             Note that  no SET  statement can  exceed one input line. You
  3899.             can break  up complicated  expressions into  a series of SET
  3900.             statements if you need to.
  3901.             
  3902.             A short example:
  3903.             
  3904.                  DECLARE a String
  3905.                  DECLARE b String
  3906.                  DECLARE c Integer
  3907.                  DECLARE d Integer
  3908.                  SET a = 'HERE IS A LINE OF TEXT WITH 123 in it'
  3909.                  SET d = POS( '1' , a )
  3910.                  SET b = Substr( a, d, 3 )
  3911.                  SET c = NUMBER( b , d )
  3912.                  
  3913.             At this point, the value of 'c' is 123.
  3914.             
  3915.             The last four lines could also be written:
  3916.             
  3917.                  SET a = 'HERE IS A LINE OF TEXT WITH 123 in it'
  3918.                  SET c = NUMBER( Substr( a, d, 3 ) , POS( '1' , a ) )
  3919.             
  3920.             Here is a more complicated arithmetic assignment:
  3921.             
  3922.                  SET c = ( ( c * 24 ) / D ) + 13
  3923.             
  3924.             
  3925.             SetParam -- Set Value Of PibTerm Parameter
  3926.             SetParam -- Set Value Of PibTerm Parameter
  3927.             
  3928.             SetParam sets  a PibTerm parameter to a specified value. The
  3929.             syntax is:
  3930.             
  3931.                  SetParam  Spname  Spval
  3932.             
  3933.  
  3934.  
  3935.             PibTerm Script Language Reference Guide              Page 56
  3936.             PibTerm Script Language Reference Guide              Page 56
  3937.  
  3938.  
  3939.             Spname is the name of the parameter.
  3940.             Spname                              
  3941.             Spval is the new parameter value.
  3942.             Spval                            
  3943.             
  3944.             If a  PibTerm parameter is of boolean type, enter "1" to set
  3945.             the parameter  value to  True, or enter "0" to set the value
  3946.             to False.  (See the "Parameter Language Reference Manual" to
  3947.             determine the type for each PibTerm parameter.)
  3948.             
  3949.             To increase  the efficiency  of processing  several SetParam
  3950.             statements, try  to place  them one right after the other if
  3951.             possible.  This avoids extra code module swaps during script
  3952.             execution.
  3953.             
  3954.             Examples:
  3955.             
  3956.             
  3957.                  Declare Name String
  3958.                  Declare Rate String
  3959.                  Declare True String
  3960.                  *                           Set terminal type to VT100
  3961.                  SetParam "te" "3"
  3962.                  
  3963.                  *                           Change baud rate to 1200
  3964.                  Set Rate = "1200"
  3965.                  Set Name = "ba"
  3966.                  SetParam name rate
  3967.                  *
  3968.                  *                           Set hardwired mode
  3969.                  *
  3970.                  Set True = "1"
  3971.                  SetParam "hw" True
  3972.             
  3973.             
  3974.             SetVar -- Set Value of PibTerm Parameter
  3975.             SetVar -- Set Value of PibTerm Parameter
  3976.             
  3977.             
  3978.             SetVar sets  the  most  recent  instantiation  of  a  script
  3979.             SetVar                                                      
  3980.             variable to a specified value.  The syntax is:
  3981.             
  3982.                  SETVAR Svname Sval
  3983.             
  3984.             Svname provides the name of the variable to be set.
  3985.             Svname                                             
  3986.             Sval is the new value for the variable.
  3987.             Sval                                   
  3988.             
  3989.             SetVar has  a different  purpose than  the Set command.  The
  3990.                                                        Set              
  3991.             Set command  is translated  into internal code at the time a
  3992.             script is  compiled.    You  cannot  therefore  use  Set  to
  3993.             reference a  variable whose  name you  don't know  until the
  3994.             script is  being executed.   With  SetVar, you  can assign a
  3995.             value to  a variable  whose name  you don't  know until  the
  3996.             execution time  of the  script. Note  that  SetVar  is  MUCH
  3997.             slower than using a Set command;  use Set if possible. Also,
  3998.  
  3999.  
  4000.             PibTerm Script Language Reference Guide              Page 57
  4001.             PibTerm Script Language Reference Guide              Page 57
  4002.  
  4003.  
  4004.             SetVar doesn't allow an expression as a value, although this
  4005.             isn't a real problem: you can use a Set command to build the
  4006.             value of the Sval parameter to SetVar.
  4007.                          Sval                     
  4008.             
  4009.             Examples:
  4010.             
  4011.                  Declare vtype string
  4012.                  Declare vval  string
  4013.                  Declare vname string
  4014.                  Declare I     Integer
  4015.                  ...
  4016.                  SetVar 'VARA' 'Hi there'
  4017.                  SET vname = 'VARA'
  4018.                  SET vval  = 'Hi there'
  4019.                  SetVar vname vval
  4020.                  SetVar 'I' '10'
  4021.                  
  4022.             
  4023.             SText -- Send Text To Remote System
  4024.             SText -- Send Text To Remote System
  4025.             
  4026.             SText sends text to the remote system. The syntax is:
  4027.             SText                                                
  4028.             
  4029.                  SText String
  4030.             
  4031.             String contains the text to be sent.
  4032.             String                              
  4033.             
  4034.             The special  characters used  in function  keys for carriage
  4035.             returns, marking  control characters, and delays may be used
  4036.             in SText  as well.   (See the section on the <ALT>K keyboard
  4037.             command in  the PibTerm  Guide for  details on these special
  4038.             characters.)
  4039.             
  4040.             You've already  seen a number of examples of SText in action
  4041.             in the description of other commands.
  4042.             
  4043.             
  4044.             Suspend -- Suspend Execution Of Script
  4045.             Suspend -- Suspend Execution Of Script
  4046.             
  4047.             Suspend suspends script execution for a given length of time
  4048.             Suspend                                                     
  4049.             (PibTerm continues executing).  The syntax is:
  4050.             
  4051.                  Suspend Itime
  4052.             
  4053.             Itime is  the length  of time  in hundredths  of a second to
  4054.             Itime                                                       
  4055.             suspend the script execution.
  4056.             
  4057.             For example,  to stop  script  processing  for  one  second,
  4058.             enter:
  4059.             
  4060.                  Suspend 100
  4061.             
  4062.             To stop script processing for half a second, enter:
  4063.             
  4064.                  Suspend 50
  4065.  
  4066.  
  4067.             PibTerm Script Language Reference Guide              Page 58
  4068.             PibTerm Script Language Reference Guide              Page 58
  4069.  
  4070.  
  4071.             
  4072.             Suspend differs  from the Delay script command in that Delay
  4073.                                       Delay                             
  4074.             stops EVERYTHING  except the reception of remote characters,
  4075.             while Suspend  only stops  the execution of script commands.
  4076.             Note,  however,  that  WaitString  and  When  searches  will
  4077.             continue during  the suspension  period.  That makes Suspend
  4078.             useful in writing conditional loops with recalcitrant remote
  4079.             systems that may require a variable number of, say, carriage
  4080.             returns before the remote system wakes up.
  4081.             
  4082.             
  4083.             Text -- Send Text To Remote System
  4084.             Text -- Send Text To Remote System
  4085.             
  4086.             Text sends  text to  the remote  system, WITHOUT any special
  4087.             Text                                                        
  4088.             interpretation (e.g., unlike SText).  The syntax is:
  4089.             
  4090.                  Text String
  4091.             
  4092.             String provides  the text to be sent.  No special processing
  4093.             String                                                      
  4094.             is performed on the text, unlike the SText command.
  4095.             
  4096.             
  4097.             Translate -- Read In Translate Table
  4098.             Translate -- Read In Translate Table
  4099.             
  4100.             Translate reads  in a  translation table  from a  file, just
  4101.             Translate                                                   
  4102.             like the "read file" option of <ALT>T.  The syntax is:
  4103.             
  4104.                  Translate Sname
  4105.             
  4106.             Sname is  the file  name from  which to read the translation
  4107.             Sname                                                       
  4108.             table.
  4109.             
  4110.             For example,  to read  a table  from the file "Striphi.tra",
  4111.             write:
  4112.             
  4113.                  Translate "striphi"
  4114.             
  4115.             The ".tra" is assumed.
  4116.             
  4117.             
  4118.             Until -- End Repeat Block
  4119.             Until -- End Repeat Block
  4120.             
  4121.             See the Repeat statement above.
  4122.                     Repeat                 
  4123.             
  4124.             
  4125.             ViewFile -- Invoke File Viewer
  4126.             ViewFile -- Invoke File Viewer
  4127.             
  4128.             ViewFile invokes  the  file  viewer  specified  by  the  LN=
  4129.             parameter.   If the  value of LN= is null, then the built-in
  4130.             PibTerm file  viewer is  invoked.    Otherwise,  the  string
  4131.             specified as  the value of LN= is executed as a DOS command,
  4132.             after making  any required  file name  substitution (see the
  4133.  
  4134.  
  4135.             PibTerm Script Language Reference Guide              Page 59
  4136.             PibTerm Script Language Reference Guide              Page 59
  4137.  
  4138.  
  4139.             description of  the LN=  parameter in the "PibTerm Parameter
  4140.             Reference Manual" for details).
  4141.             
  4142.             The syntax of ViewFile is:
  4143.             
  4144.                  ViewFile  Sname
  4145.             
  4146.             Sname specifies the name of the file to be viewed.
  4147.             Sname                                             
  4148.             
  4149.             For  example,   to  invoke   the   viewer   for   the   file
  4150.             "BOGUSCO.DAT", you could write:
  4151.             
  4152.                  ViewFile "Bogusco.dat"
  4153.             
  4154.             
  4155.             Wait -- Wait For Time Of Day
  4156.             Wait -- Wait For Time Of Day
  4157.             
  4158.             Wait stops PibTerm execution until a given time (in HH:MM:SS
  4159.             Wait                                                        
  4160.             form) is  reached, at  which time  execution proceeds.   The
  4161.             syntax is:
  4162.             
  4163.                  Wait Stime
  4164.             
  4165.             Stime provides the time to wait for in HH:MM:SS format.
  4166.             
  4167.             For example, to stop PibTerm execution until 1 AM, write:
  4168.             
  4169.                  Wait "01:00:00"
  4170.             
  4171.             The wait command only works within a given 24 hour period.
  4172.             
  4173.             
  4174.             WaitCount -- Wait For Number Of Characters
  4175.             WaitCount -- Wait For Number Of Characters
  4176.             
  4177.             WaitCount causes PibTerm to wait until a specified count of
  4178.             characters has arrived from the remote system, regardless of
  4179.             what characters they are.  The syntax is:
  4180.             
  4181.                  WAITCOUNT Icount
  4182.             
  4183.             Icount is the number of characters to wait for.
  4184.             Icount                                         
  4185.             
  4186.             Note that  NUL characters  (Ascii  0)  are  NOT  counted  if
  4187.                        NUL                                              
  4188.             received.
  4189.             
  4190.             Example:
  4191.             
  4192.  
  4193.  
  4194.             PibTerm Script Language Reference Guide              Page 60
  4195.             PibTerm Script Language Reference Guide              Page 60
  4196.  
  4197.  
  4198.                  *                   Wait for 5 characters to be received
  4199.                  Declare count integer
  4200.                  *
  4201.                  Set count = 5
  4202.                  *
  4203.                  WaitCount 5
  4204.                  WaitCount count
  4205.             
  4206.             
  4207.             WaitList -- Wait For List Of Strings
  4208.             WaitList -- Wait For List Of Strings
  4209.             
  4210.             WaitList waits  for any  of up  to twenty  strings to appear
  4211.             WaitList                                                    
  4212.             from the remote system.  The syntax is:
  4213.             
  4214.                  WaitList Index Swait1 Swait2 Swait3 ...
  4215.             
  4216.             Index is  the index  of the  string found.  Index must be an
  4217.             Index                                       Index           
  4218.             integer variable.   If  none of  the strings  is found, then
  4219.             Index is returned as 0.
  4220.             Index                  
  4221.             
  4222.             Swait1, Swait2,  etc. are  the strings  to be waited for.  I
  4223.             Swait1, Swait2                                              
  4224.             must be an integer variable.
  4225.             
  4226.             If Index  is returned  as 0,  then none  of the  strings was
  4227.                Index                                                    
  4228.             found in  the wait  time.   The wait  time is  set using the
  4229.             WaitTime command (which see).
  4230.             WaitTime                     
  4231.             
  4232.             The WaitFound  function (see  the Set  command) can  also be
  4233.                 WaitFound                     Set                       
  4234.             used to  determine if  any of  the strings was found, but it
  4235.             doesn't indicate which.
  4236.             
  4237.             WaitList is  similar  to  WaitString,  but  WaitString  only
  4238.                                       WaitString                        
  4239.             allows one  string to  be waited  on.   However,  WaitString
  4240.             executes faster than a WaitList with one string specified.
  4241.             
  4242.             Example:
  4243.             
  4244.                   Declare Index Integer
  4245.                   Declare Str1 'CONNECT'
  4246.                   Declare Str2 'NO CARRIER'
  4247.                   Declare Str3 'BUSY'
  4248.                   WaitList Index Str1 Str2 Str3 'VOICE'
  4249.                   IF ( Index > 0 ) THEN
  4250.                  *
  4251.                  *            process string found
  4252.                  *
  4253.                               ...
  4254.                   ELSE
  4255.                  *
  4256.                  *            process string not found
  4257.                  *
  4258.                               ...
  4259.                   ENDIF
  4260.             
  4261.  
  4262.  
  4263.             PibTerm Script Language Reference Guide              Page 61
  4264.             PibTerm Script Language Reference Guide              Page 61
  4265.  
  4266.  
  4267.             
  4268.             WaitQuiet -- Wait For Quiet Line
  4269.             WaitQuiet -- Wait For Quiet Line
  4270.             
  4271.             WaitQuiet waits until the communications line has been
  4272.             "quiet" -- no characters have been received -- for a
  4273.             specified length of time.  The syntax is:
  4274.             
  4275.                  WAITQUIET Itime
  4276.             
  4277.             Itime specifies the number of tenths of a second to wait for
  4278.             Itime                                                       
  4279.             the communications line to be quiet.
  4280.             
  4281.             Example:
  4282.             
  4283.                  *                Wait for 1/2 (5/10) second for quiet line
  4284.                  *
  4285.                   Declare Time Integer
  4286.                  *
  4287.                   Set Time = 5
  4288.                  *
  4289.                   WaitQuiet 5
  4290.                   WaitQuiet Time
  4291.             
  4292.             
  4293.             WaitString -- Wait For String From Remote
  4294.             WaitString -- Wait For String From Remote
  4295.             
  4296.             WaitString causes  Pibterm to  wait for  a given  string  to
  4297.             WaitString                                                  
  4298.             appear from the remote system. The syntax is:
  4299.             
  4300.                  WaitString Swait Itime
  4301.             
  4302.             Swait is the string to be waited on.
  4303.             Swait                               
  4304.             
  4305.             Itime is  the number  of seconds  to wait  for the string to
  4306.             Itime                                                       
  4307.             appear.   If Itime  is not  specified, then the current wait
  4308.                          Itime                                          
  4309.             time is  whatever was  specified  by  a  preceding  WaitTime
  4310.                                                                 WaitTime
  4311.             command.   If no previous WaitTime command was given, then a
  4312.             wait time of 30 seconds is used.
  4313.             
  4314.             If the  string does  not appear  within the  specified  time
  4315.             period,  then   execution  proceeds  with  the  next  script
  4316.             command.   WaitString can be combined with the Repeat/Until,
  4317.             While/EndWhile, and  If/Else/Endif script statements to good
  4318.             effect, since  the WaitFound (see the Set command) condition
  4319.                                WaitFound          Set                   
  4320.             is TRUE  (=1) if  the specified  string appeared,  and FALSE
  4321.             (=0) if it didn't appear.
  4322.             
  4323.             To wait until the string 'Username:' appears, write:
  4324.             
  4325.                  WaitString 'Username:'
  4326.             
  4327.             PibTerm waits  30 seconds for 'Username:' to appear.  If you
  4328.             want it to wait for, say 60 seconds, write:
  4329.             
  4330.  
  4331.  
  4332.             PibTerm Script Language Reference Guide              Page 62
  4333.             PibTerm Script Language Reference Guide              Page 62
  4334.  
  4335.  
  4336.                  WaitString 'Username:' 60
  4337.             
  4338.             You can wait for a single character:
  4339.             
  4340.                  WaitString ">"
  4341.             
  4342.             WaitString slows  down PibTerm's  execution somewhat, so you
  4343.             WaitString                                                  
  4344.             should not be surprised if the output from the remote system
  4345.             is displayed more slowly than usual.
  4346.             
  4347.             
  4348.             WaitTime -- Set Wait Time
  4349.             WaitTime -- Set Wait Time
  4350.             
  4351.             
  4352.             WaitTime  specifies   the  time   allotted  for   successful
  4353.             WaitTime                                                    
  4354.             completion of  a WaitString  or WaitList  command.   (For an
  4355.             individual WaitString,  this time  can be  overridden on the
  4356.             WaitString command itself.) The syntax is:
  4357.             
  4358.                  WAITTIME Itime
  4359.             
  4360.             Itime is  the time  in seconds  to wait.   30 seconds is the
  4361.             Itime                                                       
  4362.             default wait time.
  4363.             
  4364.             Examples:
  4365.             
  4366.                  Declare waiting Integer
  4367.                  WaitTime 25
  4368.                  Set waiting = 40
  4369.                  WaitTime waiting
  4370.             
  4371.             
  4372.             When -- Wait For String And Respond
  4373.             When -- Wait For String And Respond
  4374.             
  4375.             When waits  for a  given string  to appear  from the  remote
  4376.             When                                                        
  4377.             system --  like WaitString  -- and  then sends  a  specified
  4378.             response string.   The syntax is:
  4379.             
  4380.                  When Swait Ssend
  4381.             
  4382.             Swait is  the string  to wait for, and Ssend is the response
  4383.             Swait                                  Ssend                
  4384.             string.   Both may  be either  string  constants  or  string
  4385.             variables.
  4386.             
  4387.             When searching  stays active  until you  deactivate it using
  4388.             When                                                        
  4389.             <ALT>X, even after the script itself has finished executing.
  4390.             Hence, to  stop a script, you can enter <ALT>X, but the WHEN
  4391.             keeps on  going.   You can  enter another <ALT>X to stop the
  4392.             WHEN.  A third <ALT>X takes you out of PibTerm entirely.
  4393.             
  4394.             When slows  down PibTerm's execution somewhat, so you should
  4395.             When                                                        
  4396.             not be  surprised if the output from the remote system seems
  4397.             to be displayed more slowly than usual.
  4398.             
  4399.  
  4400.  
  4401.             PibTerm Script Language Reference Guide              Page 63
  4402.             PibTerm Script Language Reference Guide              Page 63
  4403.  
  4404.  
  4405.             Examples:
  4406.             
  4407.                  Declare Whenwait String
  4408.                  Declare Whensend String
  4409.                  *
  4410.                  WHEN 'Username: ' 'MYUSERID|'
  4411.                  *
  4412.                  Set Whenwait = 'Username: '
  4413.                  Set Whensend = 'MYUSERID|'
  4414.                  *
  4415.                  WHEN Whenwait Whensend
  4416.             
  4417.             
  4418.             WhenDrop -- Take Action On Carrier Drop
  4419.             WhenDrop -- Take Action On Carrier Drop
  4420.             
  4421.             WhenDrop specifies  a string  to be sent to the modem when a
  4422.             WhenDrop                                                    
  4423.             carrier drop is detected. The syntax is:
  4424.             
  4425.                  WHENDROP Ssend
  4426.             
  4427.             Ssend is  the string  to be  sent out  the port to the modem
  4428.             Ssend                                                       
  4429.             when the carrier drops.
  4430.             
  4431.             WhenDrop is useful for resetting a modem when a carrier drop
  4432.             occurs.  Since Ssend  may contain an Execute PibTerm command
  4433.                            Ssend                 Execute                
  4434.             function, this allows you to deal with many conditions on  a
  4435.             carrier drop.   This WhenDrop condition can co-exist with an
  4436.             ordinary When condition.
  4437.                      When           
  4438.             
  4439.             Example:
  4440.             
  4441.                  WhenDrop "@G@/WEDIED^M/"
  4442.             
  4443.             
  4444.             This says  that when  the carrier drop occurs, PibTerm is to
  4445.             execute the script "WEDIED.SCR". (@G --> <ALT>G, @/WEDIED^M/
  4446.             -->  WEDIED   followed  by  CHR(CR),  so  script  WEDIED  is
  4447.             executed.)
  4448.             
  4449.             
  4450.             WhereXY -- Return Current Cursor Position
  4451.             WhereXY -- Return Current Cursor Position
  4452.             
  4453.             WhereXY returns  the current  row and column position of the
  4454.             WhereXY                                                     
  4455.             cursor on the screen.  The syntax is:
  4456.             
  4457.                  WhereXY Icolumn Irow
  4458.             
  4459.             Icolumn receives  the column  position and Irow receives the
  4460.             Icolumn                                    Irow             
  4461.             row position.  Both must be integer variables.
  4462.             
  4463.             
  4464.  
  4465.  
  4466.             PibTerm Script Language Reference Guide              Page 64
  4467.             PibTerm Script Language Reference Guide              Page 64
  4468.  
  4469.  
  4470.             While -- Execute Statements While Condition True
  4471.             While -- Execute Statements While Condition True
  4472.             
  4473.             While begins a block of statements to be repeatedly executed
  4474.             While                                                       
  4475.             as long as the specified condition on the While statement is
  4476.             true. A  While block is terminated by an EndWhile statement.
  4477.                                                      EndWhile           
  4478.             The form  of  the  condition  for  the  While  statement  is
  4479.             identical to that for the Until and If statements.
  4480.                                       Until     If            
  4481.             
  4482.             For example, to execute a block of script statements as long
  4483.             as PibTerm is connected to a remote system, write:
  4484.             
  4485.                  While ( Connected ) Do
  4486.                       .
  4487.                       .
  4488.                       .
  4489.                  EndWhile
  4490.             
  4491.             
  4492.             See the  Set statement  for details on Connected, and the If
  4493.                      Set                           Connected          If
  4494.             statement for details on conditions.
  4495.             
  4496.             
  4497.             Write -- Write Characters To File
  4498.             Write -- Write Characters To File
  4499.             
  4500.             Write writes  characters to  a file  prepared  by  the  Open
  4501.             Write                                                   Open
  4502.             command. The syntax is:
  4503.             
  4504.                  WRITE Ifile Sdata
  4505.             
  4506.             where Ifile is the file handle of the file, and Sdata is the
  4507.                   Ifile                                     Sdata       
  4508.             string of characters to be written.
  4509.             
  4510.             A handle  of 0  refers to the screen.  A missing file handle
  4511.             also refers to the screen.
  4512.             
  4513.             You can  use the  IOResult function to check for errors (see
  4514.                               IOResult                                  
  4515.             the Set command).
  4516.                 Set          
  4517.             
  4518.             Examples:
  4519.             
  4520.                   Declare handle integer
  4521.                   Declare HiString String
  4522.                  *
  4523.                   Open 1 "bogusco.dat" "O"
  4524.                  *
  4525.                   WRITE 1 'Hi there!'
  4526.                  *
  4527.                   Set HiString = 'Hi there!'
  4528.                   Set handle = 1
  4529.                  *
  4530.                   WRITE handle HiString
  4531.             
  4532.             
  4533.  
  4534.  
  4535.             PibTerm Script Language Reference Guide              Page 65
  4536.             PibTerm Script Language Reference Guide              Page 65
  4537.  
  4538.  
  4539.             Writeln -- Write Line To File
  4540.             Writeln -- Write Line To File
  4541.             
  4542.             Writeln writes  a string to a file, terminated by a carriage
  4543.             Writeln                                                     
  4544.             return and linefeed.  The syntax is:
  4545.             
  4546.                  WRITELN Ifile Sdata
  4547.             
  4548.             Ifile is  the file  handle and  Sdata is  the string  to  be
  4549.             Ifile                           Sdata                       
  4550.             written.   Ifile may  be either  an integer  or  an  integer
  4551.                        Ifile                                            
  4552.             constant.   Sdata  may  be  either  a  string  or  a  string
  4553.                         Sdata                                           
  4554.             constant.   Sdata should NOT have the ^M^J (carriage return-
  4555.                         Sdata                                           
  4556.             linefeed) specified  as part  of the string; those are added
  4557.             automatically.
  4558.             
  4559.             A file  handle of  0 refers  to the  screen.  A missing file
  4560.             handle also refers to the screen.
  4561.             
  4562.             Examples:
  4563.                  
  4564.                   Declare handle integer
  4565.                   Declare HiString String
  4566.                  *
  4567.                   WRITELN 1 'Hi there!'
  4568.                  *
  4569.                   Set HiString = 'Hi there!'
  4570.                   Set handle = 1
  4571.                  *
  4572.                   WRITELN handle HiString
  4573.                  *
  4574.                   WRITELN 0 'This appears on screen.'
  4575.                   WRITELN 'This also appears on screen.'
  4576.                  
  4577.             
  4578.             WriteLog -- Write String To Log Files
  4579.             WriteLog -- Write String To Log Files
  4580.             
  4581.             WriteLog writes  the contents  of a  string to  all  of  the
  4582.             WriteLog                                                    
  4583.             active log  files.   These include  the review  buffer,  the
  4584.             capture file,  the PIBTERM.LOG  log file, and the printer --
  4585.             whichever are  in use  (if any).    The  string  is  written
  4586.             preceded by  the current  date and  time in standard PibTerm
  4587.             logging format.
  4588.             
  4589.             The syntax is:
  4590.             
  4591.                  WRITELOG Slog
  4592.             
  4593.             Slog is  the string  to be  written.   Slog can  be either a
  4594.             Slog                                   Slog                 
  4595.             string variable or a string constant.
  4596.             
  4597.             
  4598.             Using Script Commands in Command Line Mode
  4599.             Using Script Commands in Command Line Mode
  4600.             
  4601.             You can  enter a  script command  from the  keyboard.   This
  4602.             allows you to use PibTerm in a command-driven fashion if you
  4603.  
  4604.  
  4605.             PibTerm Script Language Reference Guide              Page 66
  4606.             PibTerm Script Language Reference Guide              Page 66
  4607.  
  4608.  
  4609.             dislike the  menus.   To do  this you  need to  define a key
  4610.             which will invoke command mode.  This is done at the <ALT>P,
  4611.             O)dds and ends, b) command key definition submenu.  You will
  4612.             be asked  to hit  the key which will be subsequently used to
  4613.             invoke command  mode.    This  key  must  be  one  of  those
  4614.             available for definition at <ALT>K.
  4615.             
  4616.             There is  NO DEFAULT  value for  the command line key, i.e.,
  4617.             PibTerm does not provide command line mode by default.
  4618.             
  4619.             Hitting the command key causes the status line (usually line
  4620.             25) of  the display to show 'Command: '.  You may then enter
  4621.             a script command which will be immediately executed.
  4622.             
  4623.             For example, you might enter the command
  4624.             
  4625.                  Dial "1"
  4626.             
  4627.             to dial the first number in the dialing directory, or
  4628.             
  4629.                  SetParam "pa" "N"
  4630.             
  4631.             to set no parity.
  4632.             
  4633.             If the  command is  incorrectly entered, an error message is
  4634.             printed on the status line.
  4635.             
  4636.             You may  add  your  own  user-defined  commands.    See  the
  4637.             description of  the  AddCommand  script  command  above  for
  4638.                                  AddCommand                             
  4639.             details.
  4640.             
  4641.             
  4642.             Script Commands Legal In Command Line Mode
  4643.             Script Commands Legal In Command Line Mode
  4644.             
  4645.             The following subset of script commands can be used sensibly
  4646.             in command line mode:
  4647.             
  4648.                  Addlf     Alarm     Break     Capture   ChDir     
  4649.                  Clear     ComDrain  ComFlush  CopyFile  Delay     
  4650.                  Dial      Dos       Echo      EditFile  EraseFile 
  4651.                  Execute   Exit      ExitAll   FreeSpace GetDir    
  4652.                  GetParam  Hangup    Host      Input     Key       
  4653.                  KeyDef    KeyFlush  KeySend   Log       Message   
  4654.                  Mute      Param     PrintFile Quit      Receive   
  4655.                  Redial    RInput    ScreenDump          Send      
  4656.                  SetParam  SText     Suspend   Text      Translate 
  4657.                  ViewFile  Wait      WaitCount WaitList  WaitQuiet 
  4658.                  WaitString          WaitTime  When      WhenDrop  
  4659.                  WriteLog
  4660.                  
  4661.             
  4662.             Some of  the other  commands may  be  accepted,  but  aren't
  4663.             probably useful  in command line mode.  Some of the commands
  4664.             (like IF, REPEAT, etc.) will NOT be accepted at all.
  4665.  
  4666.  
  4667.             PibTerm Script Language Reference Guide              Page 67
  4668.             PibTerm Script Language Reference Guide              Page 67
  4669.  
  4670.  
  4671.             
  4672.             
  4673.             Sample Scripts
  4674.             Sample Scripts
  4675.             
  4676.             The script  language in  PibTerm is  complicated enough that
  4677.             some extended examples are useful in showing how scripts can
  4678.             be constructed  for common  login sequences.   You  can also
  4679.             find some  script examples  in the "Guide to Using PibTerm."
  4680.             There are  also a  number of sample scripts (including those
  4681.             shown  here)   provided  as  part  of  the  PibTerm  release
  4682.             materials (look for the files ending in ".SCR").
  4683.             
  4684.             Notice how similar all of the login scripts are.  You should
  4685.             be able  to modify  one of  these  (or  one  of  the  others
  4686.             provided as  part of  the  PibTerm  release  materials)  for
  4687.             nearly any type of mainframe, mini, or remote bulletin board
  4688.             system you wish to access.
  4689.             
  4690.             
  4691.             CDC/NOS login script
  4692.             CDC/NOS login script
  4693.             
  4694.             Here is a script for automatically logging on to the CDC NOS
  4695.             mainframe system  at ACNS.   Other  CDC sites will generally
  4696.             require a different sequence:
  4697.             
  4698.             
  4699.             ***************************************************************************
  4700.             *       N O S . S C R --- Script for connecting to Cyber NOS system       *
  4701.             ***************************************************************************
  4702.             *                                                                         *
  4703.             *    Script:  Nos.Scr                                                     *
  4704.             *                                                                         *
  4705.             *    Purpose: Connects to Cyber NOS system.  Designed for use as          *
  4706.             *             attached script in dialing directory.                       *
  4707.             *                                                                         *
  4708.             *    Invocation:                                                          *
  4709.             *                                                                         *
  4710.             *       Execute "Nos"                                                     *
  4711.             *                                                                         *
  4712.             *    Remarks:                                                             *
  4713.             *                                                                         *
  4714.             *       Change the values of "username" and "password" to those of        *
  4715.             *       your own NOS account.                                             *
  4716.             *                                                                         *
  4717.             ***************************************************************************
  4718.             *
  4719.             *                                  Send CRs to wake up autobaud
  4720.              Repeat
  4721.             *
  4722.                 SText "|"
  4723.             *                                  Wait on parity message, indicating
  4724.             *                                  baud rate/parity detected
  4725.                 WaitString "arity" 4
  4726.             *
  4727.  
  4728.  
  4729.             PibTerm Script Language Reference Guide              Page 68
  4730.             PibTerm Script Language Reference Guide              Page 68
  4731.  
  4732.  
  4733.              Until ( WaitFound OR ( NOT Connected ) )
  4734.             *
  4735.             *                                  If carrier dropped, quit script.
  4736.              If ( NOT Connected ) Then
  4737.                 Exit
  4738.              Endif
  4739.             *                                  Now wait for "operating system" prompt
  4740.              WaitString "ting system"
  4741.             *                                  If carrier dropped, quit script.
  4742.              If ( NOT Connected ) Then
  4743.                 Exit
  4744.              Endif
  4745.             *                                  Indicate to CDCNET that we want
  4746.             *                                  a NOS session.  For NOS/VE, we
  4747.             *                                  would send "CREC VE" instead.
  4748.              WaitQuiet 20
  4749.              SText "crec nos|"
  4750.             *                                  Wait for username prompt
  4751.              WaitString "USER NAME:"
  4752.             *                                  Send user name -- ENTER YOURS HERE.
  4753.              SText "username|"
  4754.             *                                  Wait for password prompt
  4755.              WaitString "PASSWORD:"
  4756.             *                                  Send password -- ENTER YOURS HERE.
  4757.              SText "password|"
  4758.             *                                  Wait for bulletins, etc. to pass.
  4759.              WaitQuiet 30
  4760.             *                                  Set VT100 emulation in PibTerm.
  4761.              SetParam 'VC' '0'
  4762.              SetParam 'AK' '0'
  4763.             *                                  Load NOS function keys.
  4764.              Key 'cdcnos.fnc'
  4765.             *                                  Set backspace if not already set.
  4766.              SetParam 'BS' '^H'
  4767.              SetParam 'DE' ''
  4768.             *                                  Set VT100 emulation on NOS.
  4769.              SText "SETTERM,VT100|"
  4770.             
  4771.             
  4772.             VAX/VMS login script
  4773.             VAX/VMS login script
  4774.             
  4775.             Here is  a script  to log  on to  a Vax system running under
  4776.             VMS, like the Vax 785 at ACNS:
  4777.             
  4778.             
  4779.             ***************************************************************************
  4780.             *        V A X . S C R --- Script for connecting to Vax VMS system        *
  4781.             ***************************************************************************
  4782.             *                                                                         *
  4783.             *    Script:  Vax.Scr                                                     *
  4784.             *                                                                         *
  4785.             *    Purpose: Connects to Vax VMS system.  Designed for use as            *
  4786.             *             attached script in dialing directory.                       *
  4787.             *                                                                         *
  4788.  
  4789.  
  4790.             PibTerm Script Language Reference Guide              Page 69
  4791.             PibTerm Script Language Reference Guide              Page 69
  4792.  
  4793.  
  4794.             *    Invocation:                                                          *
  4795.             *                                                                         *
  4796.             *       Execute "Vax"                                                     *
  4797.             *                                                                         *
  4798.             *    Remarks:                                                             *
  4799.             *                                                                         *
  4800.             *       Change the values of "username" and "password" to those of        *
  4801.             *       your own Vax account.                                             *
  4802.             *                                                                         *
  4803.             ***************************************************************************
  4804.             *
  4805.             *                                  Wake up Vax's autobaud.
  4806.              Repeat
  4807.             *
  4808.                 SText "|"
  4809.             *                                  Wait for "Username" prompt.
  4810.                 WaitString "Username:" 2
  4811.             *
  4812.              UNTIL ( WaitFound OR ( NOT Connected ) )
  4813.             *
  4814.             *                                  Quit if carrier dropped.
  4815.              IF ( NOT Connected ) THEN
  4816.                 Exit
  4817.              ENDIF
  4818.             *                                  Send user name -- PUT YOURS HERE.
  4819.              SText "username|"
  4820.             *                                  Wait for password prompt.
  4821.              WaitString "Password:"
  4822.             *                                  Send password -- PUT YOURS HERE.
  4823.              SText "password|"
  4824.             *
  4825.             *                                  Set VT100 emulation
  4826.              SetParam 'VC' '0'
  4827.              SetParam 'AK' '0'
  4828.             *
  4829.              WaitString "$ "
  4830.              SText "SET TERM/VT100|"
  4831.             *                                  Load Vax function keys
  4832.              IF ( EnhKeybd = 1 ) THEN
  4833.                 Key 'decvaxe.fnc'
  4834.              ELSE
  4835.                 Key 'decvax.fnc'
  4836.              ENDIF
  4837.             *                                  Set backspace if not already set.
  4838.              SetParam 'DE' '^H'
  4839.              SetParam 'BS' ''
  4840.             
  4841.             
  4842.             IBM CMS login script
  4843.             IBM CMS login script
  4844.             
  4845.             Here is a script to log on to an IBM CMS system, through an
  4846.             7171 (or equivalent) front-end:
  4847.             
  4848.             
  4849.  
  4850.  
  4851.             PibTerm Script Language Reference Guide              Page 70
  4852.             PibTerm Script Language Reference Guide              Page 70
  4853.  
  4854.  
  4855.             ***************************************************************************
  4856.             *       I B M . S C R --- Script for connecting to IBM CMS system         *
  4857.             ***************************************************************************
  4858.             *                                                                         *
  4859.             *    Script:  Ibm.Scr                                                     *
  4860.             *                                                                         *
  4861.             *    Purpose: Connects to IBM CMS system with a 7171 front end.           *
  4862.             *             Designed for use as attached script in dialing directory.   *
  4863.             *                                                                         *
  4864.             *    Invocation:                                                          *
  4865.             *                                                                         *
  4866.             *       Execute "Ibm"                                                     *
  4867.             *                                                                         *
  4868.             *    Remarks:                                                             *
  4869.             *                                                                         *
  4870.             *       Change the values of "username" and "password" to those of        *
  4871.             *       your own Ibm account.                                             *
  4872.             *                                                                         *
  4873.             ***************************************************************************
  4874.             *
  4875.             *                                  Wake up 7171 front-end
  4876.              Repeat
  4877.             *
  4878.                 SText "|"
  4879.             *                                  Wait for "Username" prompt.
  4880.                 WaitString "TYPE:" 2
  4881.             *
  4882.              Until ( WaitFound OR ( NOT Connected ) )
  4883.             *
  4884.             *                                  Quit if carrier dropped.
  4885.              IF ( NOT Connected ) THEN
  4886.                 Exit
  4887.              ENDIF
  4888.             *                                  Send terminal type of VT100
  4889.              SText "vt100|"
  4890.             *                                  Set VT100 emulation in PibTerm
  4891.              SetParam 'VC' '0'
  4892.              SetParam 'AK' '0'
  4893.             *                                  Load CMS function keys
  4894.              IF ( EnhKeybd = 1 ) THEN
  4895.                 Key      'ibmcmse.fnc'
  4896.              ELSE
  4897.                 Key      'ibmcms.fnc'
  4898.              ENDIF
  4899.             *                                  Load backspace if not already done
  4900.              SetParam 'BS' '^[[OD'
  4901.              SetParam 'DE' '^[[OD'
  4902.             *                                  Wait for intro screen to finish.
  4903.              WaitQuiet 30
  4904.             *                                  Issue login -- put your own account
  4905.             *                                  and password here.
  4906.             *
  4907.              SText "|"
  4908.              WaitQuiet 10
  4909.  
  4910.  
  4911.             PibTerm Script Language Reference Guide              Page 71
  4912.             PibTerm Script Language Reference Guide              Page 71
  4913.  
  4914.  
  4915.             *
  4916.              SText "login username password|"
  4917.             *
  4918.             
  4919.             
  4920.             LUIS login script
  4921.             LUIS login script
  4922.             
  4923.             Here is  a script  for logging  in to the LUIS system.  LUIS
  4924.             runs under  IBM CMS,  but there  is no  account and password
  4925.             required.
  4926.             
  4927.             
  4928.             ***************************************************************************
  4929.             *       L U I S . S C R --- Script for connecting to Luis system          *
  4930.             ***************************************************************************
  4931.             *                                                                         *
  4932.             *    Script:  Luis.Scr                                                    *
  4933.             *                                                                         *
  4934.             *    Purpose: Connects to Luis system.  Designed for use as               *
  4935.             *             attached script in dialing directory.                       *
  4936.             *                                                                         *
  4937.             *    Invocation:                                                          *
  4938.             *                                                                         *
  4939.             *       Execute "Luis"                                                    *
  4940.             *                                                                         *
  4941.             ***************************************************************************
  4942.             *
  4943.             *                                  Wake up protocol converter.
  4944.              Repeat
  4945.             *
  4946.                 SText "|"
  4947.             *                                  Wait for "Username" prompt.
  4948.                 WaitString "TYPE:" 2
  4949.             *
  4950.              UNTIL ( WaitFound OR ( NOT Connected ) )
  4951.             *
  4952.             *                                  Quit if carrier dropped.
  4953.              IF ( NOT Connected ) THEN
  4954.                 Exit
  4955.              ENDIF
  4956.             *                                  Send terminal type of VT100.
  4957.              SText "vt100|"
  4958.             *                                  Wait until an intro stuff clears.
  4959.              WaitQuiet 20
  4960.             *                                  Send CR to get Luis screen.
  4961.              SText "|"
  4962.             *
  4963.             *                                  Set VT100 emulation
  4964.              SetParam 'VC' '0'
  4965.              SetParam 'AK' '0'
  4966.             *                                  Load CMS function keys
  4967.              SetParam 'BS' '^[[OD'
  4968.              SetParam 'DE' '^[[OD'
  4969.             *
  4970.  
  4971.  
  4972.             PibTerm Script Language Reference Guide              Page 72
  4973.             PibTerm Script Language Reference Guide              Page 72
  4974.  
  4975.  
  4976.              IF ( EnhKeybd = 1 ) THEN
  4977.                 Key      'ibmcmse.fnc'
  4978.              ELSE
  4979.                 Key      'ibmcms.fnc'
  4980.              ENDIF
  4981.             *
  4982.             
  4983.             
  4984.             OPUS login script
  4985.             OPUS login script
  4986.             
  4987.             Here is  a script  to log on to an OPUS system.  This is the
  4988.             bulletin   board   software   currently   running   on   the
  4989.             Northwestern IBM PC bulletin board system.
  4990.             
  4991.             
  4992.             ***************************************************************************
  4993.             *        O P U S . S C R --- Script for logging into OPUS BBS system      *
  4994.             ***************************************************************************
  4995.             *                                                                         *
  4996.             *    Script:  Opus.Scr                                                    *
  4997.             *                                                                         *
  4998.             *    Purpose: Connects to OPUS system.  Designed for use as               *
  4999.             *             attached script in dialing directory.                       *
  5000.             *                                                                         *
  5001.             *    Invocation:                                                          *
  5002.             *                                                                         *
  5003.             *       Execute "Opus"                                                    *
  5004.             *                                                                         *
  5005.             *    Remarks:                                                             *
  5006.             *                                                                         *
  5007.             *       Change the values of "firstname", "lastname", and "password"      *
  5008.             *       to those of your own OPUS account.                                *
  5009.             *                                                                         *
  5010.             ***************************************************************************
  5011.             *
  5012.             *                                  Wait for name prompt.
  5013.              Waitstring "Your FIRST name:" 2
  5014.             *                                  Carrier dropped -- quit.
  5015.              If ( NOT Connected ) Then
  5016.                 Exit
  5017.              EndIf
  5018.             *                                  Didn't get "FIRST name" prompt -- quit.
  5019.              If ( NOT WaitFound ) Then
  5020.                 Exit
  5021.              Endif
  5022.             *
  5023.             *                                  Send first name, last name.
  5024.             *                                  PUT YOURS HERE.
  5025.             *
  5026.              SText   "firstname lastname|"
  5027.             *
  5028.             *                                  Reply "y" to validation prompt
  5029.             *
  5030.              Waitstring "Y,n"
  5031.  
  5032.  
  5033.             PibTerm Script Language Reference Guide              Page 73
  5034.             PibTerm Script Language Reference Guide              Page 73
  5035.  
  5036.  
  5037.              Stext "y|"
  5038.             *
  5039.             *                                 Wait for password prompt and then
  5040.             *                                 send password.
  5041.             *                                 PUT YOURS HERE.
  5042.             *
  5043.              Waitstring "assword:"
  5044.              Stext "password|"
  5045.             
  5046.             
  5047.             RBBS login script
  5048.             RBBS login script
  5049.             
  5050.             Here is  a script  to log on to an RBBS system.  This script
  5051.             may need  modification for  an individual RBBS system, since
  5052.             there can  be a  great deal  of variation as regards initial
  5053.             welcome messages and so on.
  5054.             
  5055.             
  5056.             ***************************************************************************
  5057.             *        R B B S . S C R --- Script for logging into RBBS BBS system      *
  5058.             ***************************************************************************
  5059.             *                                                                         *
  5060.             *    Script:  Rbbs.Scr                                                    *
  5061.             *                                                                         *
  5062.             *    Purpose: Connects to RBBS system.  Designed for use as               *
  5063.             *             attached script in dialing directory.                       *
  5064.             *                                                                         *
  5065.             *    Invocation:                                                          *
  5066.             *                                                                         *
  5067.             *       Execute "Rbbs"                                                    *
  5068.             *                                                                         *
  5069.             *    Remarks:                                                             *
  5070.             *                                                                         *
  5071.             *       Change the values of "firstname", "lastname", and "password"      *
  5072.             *       to those of your own RBBS account.                                *
  5073.             *                                                                         *
  5074.             ***************************************************************************
  5075.             *
  5076.             *                                  Wait for name prompt.
  5077.              WaitString "ame:"
  5078.             *                                  Send first name, last name, and password.
  5079.             *                                  PUT YOURS HERE.
  5080.             *
  5081.              SText   "firstname;lastname;password|"
  5082.             
  5083.             
  5084.             IBBS login script
  5085.             IBBS login script
  5086.             
  5087.             Here is  a script  to log  on to  an IBBS  system like  Gene
  5088.             Plantz's system in Chicago:
  5089.             
  5090.             
  5091.             ***************************************************************************
  5092.             *        I B B S . S C R --- Script for logging into IBBS BBS system      *
  5093.  
  5094.  
  5095.             PibTerm Script Language Reference Guide              Page 74
  5096.             PibTerm Script Language Reference Guide              Page 74
  5097.  
  5098.  
  5099.             ***************************************************************************
  5100.             *                                                                         *
  5101.             *    Script:  Ibbs.Scr                                                    *
  5102.             *                                                                         *
  5103.             *    Purpose: Connects to IBBS system.  Designed for use as               *
  5104.             *             attached script in dialing directory.                       *
  5105.             *                                                                         *
  5106.             *    Invocation:                                                          *
  5107.             *                                                                         *
  5108.             *       Execute "IBBS"                                                    *
  5109.             *                                                                         *
  5110.             *    Remarks:                                                             *
  5111.             *                                                                         *
  5112.             *       Change the values of "IDnnnn" and "password" to your own.         *
  5113.             *                                                                         *
  5114.             ***************************************************************************
  5115.             *
  5116.             *                                  Wait for name request
  5117.             *
  5118.              Waitstring "FIRST Name"
  5119.             *                                  Quit if not connected.
  5120.              If ( NOT Connected ) Then
  5121.                 Exit
  5122.              Endif
  5123.             *                                  Send ID number and password.
  5124.             *                                  Also request message reading from
  5125.             *                                  last previous message.
  5126.             *                                  PUT YOUR ID/PASSWORD HERE.
  5127.             *
  5128.              WaitQuiet 10
  5129.              Stext   "IDnnnn;password;m;r;*|"
  5130.             *
  5131.             
  5132.             
  5133.             CompuServe Login Script
  5134.             CompuServe Login Script
  5135.             
  5136.             Here is a sample script to log on to CompuServe.
  5137.             
  5138.             
  5139.             ***************************************************************************
  5140.             *        C I S . S C R --- Script for connecting to CompuServe            *
  5141.             ***************************************************************************
  5142.             *                                                                         *
  5143.             *    Script:  Cis.Scr                                                     *
  5144.             *                                                                         *
  5145.             *    Purpose: Connects to CompuServe.                                     *
  5146.             *                                                                         *
  5147.             *    Invocation:                                                          *
  5148.             *                                                                         *
  5149.             *       Execute "Cis"                                                     *
  5150.             *                                                                         *
  5151.             *    Remarks:                                                             *
  5152.             *                                                                         *
  5153.             *       Change the values of "user,id" and "password" to those of         *
  5154.  
  5155.  
  5156.             PibTerm Script Language Reference Guide              Page 75
  5157.             PibTerm Script Language Reference Guide              Page 75
  5158.  
  5159.  
  5160.             *       your own CIS account.                                             *
  5161.             *                                                                         *
  5162.             ***************************************************************************
  5163.             *
  5164.             *                                  Wait a few seconds for network to activate
  5165.              Suspend 300
  5166.             *                                  Wake up CompuServe
  5167.              SText "^C"
  5168.             *                                  Wait for userid prompt
  5169.              WaitString "User"
  5170.             *                                  Send userid -- PUT YOURS HERE
  5171.              SText "user,id|"
  5172.             *                                  Wait for password prompt
  5173.              WaitString "Password:"
  5174.             *                                  Send password -- PUT YOURS HERE
  5175.              SText "password|"
  5176.             *                                  Wait for main prompt
  5177.              WaitString " !"
  5178.             *                                  Turn on CompuServe B protocol
  5179.              SetParam "BP" "1"
  5180.             *
  5181.             
  5182.             
  5183.             Using A Password File
  5184.             Using A Password File
  5185.             
  5186.             PibTerm does  not store  the passwords for remote systems in
  5187.             the dialing  directory, for security purposes.  However, you
  5188.             may want  to keep  a file  of passwords  for remote  systems
  5189.             anyway, in  order to  better automate your scripts for those
  5190.             systems.   You can use the script facilities and text editor
  5191.             in PibTerm to maintain a password file.
  5192.             
  5193.             For example, if you regularly dial into a dozen different PC
  5194.             Board systems, you could write separate very similar scripts
  5195.             for  each   system  with   your  unique   ID  and  password.
  5196.             Alternatively, you  could write  one general  script and get
  5197.             the password for a particular system from a password file.
  5198.             
  5199.             Following is  a script  GETPASS.SCR which can be EXECUTEd by
  5200.                                                              EXECUTE    
  5201.             another script to retrieve passwords from the password file.
  5202.             The initial  comments in  this script detail how to create a
  5203.             password file.
  5204.             
  5205.             
  5206.             ***************************************************************************
  5207.             *       G E T P A S S . S C R  --- Get password for remote system         *
  5208.             ***************************************************************************
  5209.             *
  5210.             *                                  Dialing entry to get password for
  5211.              Import DEntry Integer
  5212.             *                                  Name of dialed system to return to caller
  5213.              Import SysName String
  5214.             *                                  Password to return to calling script
  5215.              Import PassWord String
  5216.  
  5217.  
  5218.             PibTerm Script Language Reference Guide              Page 76
  5219.             PibTerm Script Language Reference Guide              Page 76
  5220.  
  5221.  
  5222.             *
  5223.             ***************************************************************************
  5224.             *                                                                         *
  5225.             *    Script:  GetPass.Scr                                                 *
  5226.             *                                                                         *
  5227.             *    Purpose: Returns entry in password file corresponding to             *
  5228.             *             given dialing entry.                                        *
  5229.             *                                                                         *
  5230.             *    Invocation:                                                          *
  5231.             *                                                                         *
  5232.             *       Execute 'GetPass'  DialEnt SysName PassWord                       *
  5233.             *                                                                         *
  5234.             *          DialEnt  --- Number of entry to get password for               *
  5235.             *          SysName  --- Name of System for entry 'DialEnt'                *
  5236.             *          PassWord --- Password for entry 'DialEnt'                      *
  5237.             *                                                                         *
  5238.             *    Remarks:                                                             *
  5239.             *                                                                         *
  5240.             *       PibTerm does not store passwords for systems to be dialed in the  *
  5241.             *       dialing directory.  This is for security reasons.  However,       *
  5242.             *       you may find it convenient to maintain a file of passwords for    *
  5243.             *       each system on your own.  You can do this with the built-in       *
  5244.             *       PibTerm editor, for example.                                      *
  5245.             *                                                                         *
  5246.             *       This script provides a mechanism for accessing your password      *
  5247.             *       file from another script invoked as the result of a PibTerm       *
  5248.             *       request.  Your dialing script just needs to invoke this script    *
  5249.             *       as indicated above.                                               *
  5250.             *                                                                         *
  5251.             *       Using a password file allows you to write one script which can    *
  5252.             *       handle the signon sequence for a number of remote systems.  For   *
  5253.             *       example, you can write a generic routine to log into PC Board     *
  5254.             *       systems.  Then you can attach this generic script to the dialing  *
  5255.             *       entries for all the PC Board systems you call.  The major         *
  5256.             *       difference will be the password, and using GETPASS.SCR allows you *
  5257.             *       to handle that difference rather easily.                          *
  5258.             *                                                                         *
  5259.             *       The password file is assumed to be called 'c:\pibterm\mypass.dat' *
  5260.             *       but you can change that to whatever name you like.  The format    *
  5261.             *       of the password file is simple:  for each entry in the dialing    *
  5262.             *       directory, place the system's name, followed by a colon (:),      *
  5263.             *       followed by the system's password on the matching line            *
  5264.             *       number in the password file.  Hence, if your dialing directory    *
  5265.             *       (PIBTERM.FON) has 25 entries, then your password file should also *
  5266.             *       have 25 lines.  Each line has the name and password corresponding *
  5267.             *       to one dialing entry.  For example, the 10th line in the password *
  5268.             *       file should have the name and password for the 10th entry in the  *
  5269.             *       dialing directory                                                 *
  5270.             *                                                                         *
  5271.             *       A non-existent password is returned as a null string.             *
  5272.             *                                                                         *
  5273.             *       While you won't stop a dedicated "hacker" from finding it, you    *
  5274.             *       may want to assign a "hidden" file attribute to your password     *
  5275.             *       file.  The GetPass script will still be able to read it, but      *
  5276.  
  5277.  
  5278.             PibTerm Script Language Reference Guide              Page 77
  5279.             PibTerm Script Language Reference Guide              Page 77
  5280.  
  5281.  
  5282.             *       casual "perusers" of your hard disk won't find it in a standard   *
  5283.             *       DIR listing.                                                      *
  5284.             *                                                                         *
  5285.             ***************************************************************************
  5286.             *
  5287.             *                                  Current entry in password file
  5288.              Declare IEntry Integer
  5289.             *                                  Return null password in case of error
  5290.              PassWord = ''
  5291.             *                                  Ditto for System Name
  5292.              SysName  = ''
  5293.             *                                  Make sure dialing # is reasonable
  5294.              IF ( DEntry <= 0 ) THEN
  5295.                 EXIT
  5296.              ENDIF
  5297.             *                                  Open password file.
  5298.             *                                  Change name to whatever you want.
  5299.             *
  5300.              Open 1 'c:\pibterm\MyPass.dat' 'Input'
  5301.             *
  5302.             *                                  Check that open went OK -- if not,
  5303.             *                                  return to caller.
  5304.              IF ( IOResult <> 0 ) THEN
  5305.                 EXIT
  5306.              ENDIF
  5307.             *                                  Skip down to correct entry
  5308.             *
  5309.              FOR IEntry = 1 TO ( DEntry - 1 ) DO
  5310.                 Readln 1 SysName
  5311.                 IF ( IOResult <> 0 ) THEN
  5312.                    SysName = ''
  5313.                    CLOSE 1
  5314.                    EXIT
  5315.                 ENDIF
  5316.              ENDFOR
  5317.             *                                 Read correct entry
  5318.              Readln 1 SysName
  5319.             *
  5320.              IF ( IOResult <> 0 ) THEN
  5321.                 SysName = ''
  5322.                 CLOSE 1
  5323.                 EXIT
  5324.              ENDIF
  5325.             *                                  Close password file
  5326.              Close 1
  5327.             *                                  Parse out system name and password
  5328.             *                                   System Name begins line, then a colon (:),
  5329.             *                                   and then the password
  5330.              Set IEntry = Index(':', SysName)
  5331.              If ( IEntry = 0 ) then
  5332.                 SysName = ''
  5333.                 Exit
  5334.              EndIf
  5335.              Set Password = Trim( LTrim( SubStr(SysName, IEntry+1, Length(SysName)-IEntry)))
  5336.  
  5337.  
  5338.             PibTerm Script Language Reference Guide              Page 78
  5339.             PibTerm Script Language Reference Guide              Page 78
  5340.  
  5341.  
  5342.              Set SysName  = Trim( LTrim( SubStr(SysName, 1, IEntry-1)))
  5343.             *
  5344.             
  5345.             
  5346.             PC Board Login Script Using Password File
  5347.             PC Board Login Script Using Password File
  5348.             
  5349.             As an  example of how to use the GETPASS.SCR script, here is
  5350.             a generalized  PC Board  login script  written by Richard P.
  5351.             Byrne:
  5352.             
  5353.             
  5354.             *
  5355.                Declare  SysName     String
  5356.                Declare  PassWord    String
  5357.                Declare  DialEnt     Integer
  5358.                Declare  StrIdx      Integer
  5359.                Declare  TimeOut     Integer  10
  5360.                Declare  LoopCount   Integer   0
  5361.                Declare  CaptStatus  String  'OFF'
  5362.             *
  5363.             ******************************************************************************
  5364.             *                                                                            *
  5365.             *   Script:     PCBOARD.SCR                                                  *
  5366.             *                                                                            *
  5367.             *   Purpose:    Automated logon for PCBoard bulletin board systems.          *
  5368.             *                                                                            *
  5369.             *   Invocation: This script is meant to be invoked from the dialing          *
  5370.             *               directory.                                                   *
  5371.             *                                                                            *
  5372.             *   Remarks:    Creates a file called PCB_NEWS.TXT that will contain the     *
  5373.             *               first screenful of News displayed by the system (if any).    *
  5374.             *                                                                            *
  5375.             *               This script calls the GETPASS script to return the name      *
  5376.             *               of the system being accessed plus the password for that      *
  5377.             *               system.                                                      *
  5378.             *                                                                            *
  5379.             ******************************************************************************
  5380.             *
  5381.             *                             Get entry number of system dialed
  5382.                Set DialEnt = Dialed
  5383.             *                             Wait for the "graphics" prompt
  5384.             *
  5385.                WaitString '=no?' TimeOut
  5386.                If (WaitFound) then
  5387.             *                             Use graphics for this call
  5388.                   SText 'Y Q|'
  5389.             
  5390.             *                             Get name of system + password from Mypass.Dat file
  5391.             *
  5392.                   Execute 'getpass' DialEnt SysName PassWord
  5393.             *
  5394.             *                             Format Password for use by combining
  5395.             *                             with logon id (ie. first & last name)
  5396.             *
  5397.  
  5398.  
  5399.             PibTerm Script Language Reference Guide              Page 79
  5400.             PibTerm Script Language Reference Guide              Page 79
  5401.  
  5402.  
  5403.                   Set PassWord = CONCAT('FirstName LastName ', PassWord)
  5404.                   Set PassWord = CONCAT( PassWord , '|' )
  5405.             *
  5406.             *                             Format System Name for log file entry
  5407.             *
  5408.                   Set SysName  = CONCAT('Captured News Items for ', SysName)
  5409.             *
  5410.             *                             Turn on capture in case there's news
  5411.             *
  5412.                   Capture 'C:\pcbdir\PCB_News.Txt' 'E'
  5413.             *
  5414.             *                             Set capture file status flag to
  5415.             *                             indicate an open log file
  5416.             *
  5417.                   Set CaptStatus = 'ON'
  5418.             *
  5419.             *                             Write system name to log file
  5420.             *
  5421.                   WriteLog '========================================================'
  5422.                   WriteLog SysName
  5423.                   WriteLog '========================================================'
  5424.             
  5425.             *                             Send logon id and password
  5426.                   SText PassWord
  5427.             
  5428.             *                             Set WaitTime to one second
  5429.                   WaitTime 1
  5430.             *                             Loop until we get to main command prompt
  5431.                   Repeat
  5432.                      WaitList StrIdx 'continue?' '=no?' '(NS)?' '=yes?' 'Command?'
  5433.                      Set LoopCount = LoopCount + 1
  5434.                      DoCase StrIdx
  5435.                         Case 1
  5436.             *                             Answer the "Press (Enter) to continue?"
  5437.             *                             prompt
  5438.                            SText '|'
  5439.             *                             And re-initialize our "dead-man"
  5440.             *                             loop counter
  5441.             *
  5442.                            Set LoopCount = 0
  5443.                         EndCase
  5444.                         Case 2
  5445.             *                             Conference "auto-joined" ...
  5446.             *                             Answer the "view others" prompt
  5447.                            SText '|'
  5448.             *                             And re-initialize our "dead-man"
  5449.             *                             loop counter
  5450.             *
  5451.                            Set LoopCount = 0
  5452.                         EndCase
  5453.                         Case 3
  5454.             *                             Answer the "More: (Y), (N), (NS)?"
  5455.             *                             prompt
  5456.                            SText 'N|'
  5457.  
  5458.  
  5459.             PibTerm Script Language Reference Guide              Page 80
  5460.             PibTerm Script Language Reference Guide              Page 80
  5461.  
  5462.  
  5463.             *                             And re-initialize our "dead-man"
  5464.             *                             loop counter
  5465.             *
  5466.                            Set LoopCount = 0
  5467.                         EndCase
  5468.                         Case 4
  5469.             *                             Turn off capture and scan all
  5470.             *                             message bases for mail
  5471.             *
  5472.                            If ( CaptStatus = 'ON' ) Then
  5473.                               Capture
  5474.                               Set CaptStatus = 'OFF'
  5475.                            EndIf
  5476.                            SText 'A NS|'
  5477.                            Set LoopCount = 0
  5478.                         EndCase
  5479.                      EndDoCase
  5480.                   Until (StrIdx = 5) or (LoopCount = TimeOut)
  5481.             
  5482.                EndIf
  5483.             *
  5484.             *                             If the capture file is still on (?),
  5485.             *                             then turn it off
  5486.             *
  5487.                If ( CaptStatus = 'ON' ) Then
  5488.                   Capture
  5489.                EndIf
  5490.             *                             That's all folks!
  5491.             
  5492.             
  5493.             Reading A New Configuration File
  5494.             Reading A New Configuration File
  5495.             
  5496.             The PibTerm  script language  doesn't provide a direct means
  5497.             of  reading   in  a   parameter  configuration   file   like
  5498.             PIBTERM.CNF.   Reading in  a new  configuration file  can be
  5499.             very useful  if  you  want  to  change  a  large  number  of
  5500.             parameters at  once.   However, you can use the input/output
  5501.             facilities of PibTerm to read a new configuration file.
  5502.             
  5503.             Here is  a script  which can  be EXECUTEd by another script,
  5504.                                              EXECUTE                    
  5505.             and which will read and process a configuration file.
  5506.             
  5507.             
  5508.             ***************************************************************************
  5509.             *       R E A D C O N F . S C R --- Read configuration file               *
  5510.             ***************************************************************************
  5511.             *
  5512.             *                                  Name of configuration file to be read
  5513.              Import ConfName String
  5514.             *
  5515.             ***************************************************************************
  5516.             *                                                                         *
  5517.             *    Script:  ReadConf.Scr                                                *
  5518.             *                                                                         *
  5519.  
  5520.  
  5521.             PibTerm Script Language Reference Guide              Page 81
  5522.             PibTerm Script Language Reference Guide              Page 81
  5523.  
  5524.  
  5525.             *    Purpose: Reads a configuration file and resets PibTerm parameters.   *
  5526.             *                                                                         *
  5527.             *    Invocation:                                                          *
  5528.             *                                                                         *
  5529.             *       Execute "ReadConf" ConfName                                       *
  5530.             *                                                                         *
  5531.             *          ConfName --- Configuration file to read                        *
  5532.             *                                                                         *
  5533.             *          Example:    Execute "ReadConf" "Bogusco.Cnf"                   *
  5534.             *                                                                         *
  5535.             ***************************************************************************
  5536.             *
  5537.             *                                  Configuration line
  5538.              Declare ConfLine String
  5539.             *                                  Configuration parameter name
  5540.              Declare ConfName String
  5541.             *                                  Configuration parameter value
  5542.              Declare ConfValue String
  5543.             *                                  Open configuration file.
  5544.             *
  5545.              Open 1 ConfName "Input"
  5546.             *
  5547.             *                                  Check that open went OK -- if not,
  5548.             *                                  return to caller.
  5549.              IF ( IOResult <> 0 ) THEN
  5550.                 EXIT
  5551.              ENDIF
  5552.             *                                  Begin loop over configuration file.
  5553.              REPEAT
  5554.             *                                  Read line from configuration file.
  5555.                 Readln 1 ConfLine
  5556.             *                                  Parse into parameter name and value.
  5557.             *
  5558.                 ConfName  = Substr( ConfLine, 1, 2 )
  5559.                 ConfValue = Substr( ConfLine, 4, 255 )
  5560.             *
  5561.             *                                  Set parameter value.
  5562.                 SetParam ConfName ConfValue
  5563.             *
  5564.              UNTIL ( EOF( 1 ) )
  5565.             *                                  Close configuration file
  5566.              Close 1
  5567.             
  5568.             
  5569.             Defining Scripts For External Transfer Protocols
  5570.             Defining Scripts For External Transfer Protocols
  5571.             
  5572.             As indicated  in the  "Guide to  PibTerm", it is possible to
  5573.             hook external  file transfer  protocols into  PibTerm  using
  5574.             either batch  files or  scripts.   The  "Guide  to  PibTerm"
  5575.             describes the procedure for using batch files.  This section
  5576.             discusses  the   use  of   scripts,  which   provides   more
  5577.             flexibility  but   requires  considerably  more  programming
  5578.             expertise.
  5579.             
  5580.  
  5581.  
  5582.             PibTerm Script Language Reference Guide              Page 82
  5583.             PibTerm Script Language Reference Guide              Page 82
  5584.  
  5585.  
  5586.             This section  presents scripts  for use  with MLINK.COM, the
  5587.             module written  by Paul Meiners that implements the MegaLink
  5588.             protocol.   The discussion on adding external file transfers
  5589.             to PibTerm  in  the  "Guide  to  PibTerm"    also  uses  the
  5590.             MLINK.COM program  as an  example, so  you should  have  the
  5591.             "Guide" handy for comparison.
  5592.             
  5593.             Let's begin by recapitulating the parameters expected by the
  5594.             external protocol  module.   In the  case of  MegaLink,  the
  5595.             MLINK.COM program takes argument of the form:
  5596.             
  5597.                  MLINK PORT n SPEED s RM download_directory
  5598.                  MLINK PORT n SPEED s SM
  5599.             
  5600.             where 'n' is the communications port number, 's' is the baud
  5601.             rate  of  the  connection,  RM  indicates  files  are  being
  5602.             received,  SM   indicates  files   are   being   sent,   and
  5603.             'download_directory' is  the name  of the  PibTerm  download
  5604.             directory.
  5605.             
  5606.             For example,  to receive files at 2400 baud over port 1, the
  5607.             MLINK.COM invocation should be:
  5608.             
  5609.                  MLINK PORT 1 SPEED 2400 RM C:\DOWNLOAD
  5610.             
  5611.             assuming   that    the   PibTerm   download   directory   is
  5612.             'C:\DOWNLOAD', while  to send files over port 2 at 1200 baud
  5613.             the MLINK.COM invocation should be:
  5614.             
  5615.                  MLINK PORT 2 SPEED 1200 SM
  5616.             
  5617.             In general,  a script  to receive  a file  or files contains
  5618.             statements to do the following:
  5619.             
  5620.                  1.   Save the  current drive/directory  using  the  new
  5621.                       GETDIR script command.
  5622.                  
  5623.                  2.   Move to  the select  download directory (parameter
  5624.                       DD= in  terminal mode  or HD=  in host mode) using
  5625.                       the CHDIR  script  command,  unless  the  external
  5626.                       protocol  module  has  a  way  of  specifying  the
  5627.                       download directory name.
  5628.                  
  5629.                  3.   Pick up the file name to be transferred (parameter
  5630.                       FN=) using the GETPARAM script command.
  5631.                  
  5632.                  4.   Pick  up  any  other  information  needed  by  the
  5633.                       external protocol handler, such as the port (PO=),
  5634.                       baud rate  (BA=), etc.,  again using  the GETPARAM
  5635.                       command.
  5636.                  
  5637.                  5.   Construct the  DOS command  to invoke the external
  5638.                       handler module, including the program name and all
  5639.                       of its  parameters.  This will involve a series of
  5640.  
  5641.  
  5642.             PibTerm Script Language Reference Guide              Page 83
  5643.             PibTerm Script Language Reference Guide              Page 83
  5644.  
  5645.  
  5646.                       SET statements  to CONCAT  the various  parameters
  5647.                       together.
  5648.                  
  5649.                  6.   Execute  the   external  handler   using  the  DOS
  5650.                       command.
  5651.                  
  5652.                  7.   Return to  the original  drive/directory using the
  5653.                       CHDIR command.
  5654.                  
  5655.             A script  to send  files is  similar.  In terminal mode, you
  5656.             don't need  to specify a directory from which to send files.
  5657.             In host  mode, you  should specify  the host  mode  download
  5658.             directory (HD=)  and restrict  files  to  be  sent  to  that
  5659.             subdirectory. The  easiest way  to  do  that  is  to  simply
  5660.             prepend the  host mode  directory to  the file specification
  5661.             provided by  the user  (from  FN=).    If  a  non-super-user
  5662.             requests some  other path,  the script  should strip  it, or
  5663.             just not allow the transfer.
  5664.             
  5665.             When sending  files, or  receiving files  with  a  non-batch
  5666.             protocol, you  need to know the file name(s) of the files to
  5667.             be transferred.  PibTerm will  have already prompted for the
  5668.             name.   You gain  access to  the file specification provided
  5669.             using  the  new  FN=  pseudo-parameter.  FN=  is  a  pseudo-
  5670.             parameter because  it isn't  written to  PIBTERM.CNF (and is
  5671.             ignored if  read from  there), but  it can be accessed using
  5672.             the script  command 'GetParam'  just like  a real parameter.
  5673.             The value  returned by  FN is  the file  specification  last
  5674.             entered to  PibTerm.   You can look at SENDMLIN.SCR (appears
  5675.             below) to see how to use FN=.
  5676.             
  5677.             If you  allow the protocol to execute in host mode, then you
  5678.             also need  to check  within your script whether the protocol
  5679.             has been  invoked from host mode or from terminal mode.  The
  5680.             new pseudo-parameter HP= provides this information:
  5681.             
  5682.                  HP=      -- in terminal mode (HP is a blank)
  5683.                  HP=N     -- in host mode, user is a normal user
  5684.                  HP=S     -- in host mode, user is a super-user
  5685.             
  5686.             Like FN=,  HP= is  not written to PIBTERM.CNF and is ignored
  5687.             if present in that file.
  5688.             
  5689.             NOTE:     For security  reasons in  host  mode,  when  using
  5690.                       external protocols,  make sure  that the  external
  5691.                       driver has either
  5692.             
  5693.                            (1)  a mechanism  for restricting  the  files
  5694.                            sent or received to the current directory, or
  5695.             
  5696.                            (2)  a   mechanism    for   specifying    the
  5697.                            directories from which files are sent or into
  5698.                            which files are received.
  5699.             
  5700.  
  5701.  
  5702.             PibTerm Script Language Reference Guide              Page 84
  5703.             PibTerm Script Language Reference Guide              Page 84
  5704.  
  5705.  
  5706.                       Otherwise, non-super-users  could use  an external
  5707.                       protocol  to   transfer  files   you  don't   want
  5708.                       transferred, and  which wouldn't be allowed by the
  5709.                       internal PibTerm  transfer facilities  because  of
  5710.                       the XferList  (PIBTERM.XFR) checking.  No XferList
  5711.                                      PIBTERM.XFR                        
  5712.                       checking is available for external protocols.
  5713.             
  5714.             
  5715.             Example: SENDMLIN.SCR for sending files with MegaLink
  5716.             Example: SENDMLIN.SCR for sending files with MegaLink
  5717.             
  5718.             Here is the script SENDMLIN.SCR for interfacing MLINK.COM to
  5719.             PibTerm for purposes of sending files to a remote system:
  5720.             
  5721.             
  5722.             ***************************************************************************
  5723.             *    S E N D M L I N . S C R --- Script interfacing MLINK to PibTerm      *
  5724.             ***************************************************************************
  5725.             *                                                                         *
  5726.             *    Script:  SendMLin.Scr                                                *
  5727.             *                                                                         *
  5728.             *    Purpose: Interfaces external Megalink driver program MLINK.COM       *
  5729.             *             to PibTerm for sending files.                               *
  5730.             *                                                                         *
  5731.             *    Invocation:                                                          *
  5732.             *                                                                         *
  5733.             *       Execute "SendMLin"                                                *
  5734.             *                                                                         *
  5735.             *    Remarks:                                                             *
  5736.             *                                                                         *
  5737.             *       This script is designed to be automatically invoked by the        *
  5738.             *       <ALT>S command when MegaLink has been defined as an external      *
  5739.             *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  5740.             *                                                                         *
  5741.             ***************************************************************************
  5742.             *                                                                         *
  5743.             *                                  File spec for files to transfer
  5744.                Declare FileSpec String
  5745.             *                                  Baud rate for transfer
  5746.                Declare BaudRate String
  5747.             *                                  Comm port number
  5748.                Declare Port     String
  5749.             *                                  Build MLink invocation line in this
  5750.                Declare Mlink    String
  5751.             *                                  Host mode flag
  5752.                Declare HostMode String
  5753.             *                                  Upload directory
  5754.                Declare UpDir String
  5755.             *
  5756.             **************************************************************************
  5757.             *       StripPath --- procedure to strip path from file name             *
  5758.             **************************************************************************
  5759.             *
  5760.                PROCEDURE StripPath
  5761.             *
  5762.  
  5763.  
  5764.             PibTerm Script Language Reference Guide              Page 85
  5765.             PibTerm Script Language Reference Guide              Page 85
  5766.  
  5767.  
  5768.                   Declare I  Integer
  5769.                   Declare L  Integer
  5770.                   Declare Ch String
  5771.             *
  5772.                   IF ( ( INDEX( '\' , FileSpec ) <> 0 ) OR ( INDEX( ':' , FileSpec ) <> 0 ) ) THEN
  5773.             *
  5774.                      L = LENGTH( FileSpec )
  5775.                      I = L
  5776.             *
  5777.                      REPEAT
  5778.                         I  = I - 1
  5779.                         Ch = Substr( FileSpec, I, 1 )
  5780.                      UNTIL ( ( Ch = '\' ) OR ( Ch = ':' ) )
  5781.             *
  5782.                      FileSpec = SUBSTR( FileSpec,  I + 1 , L - I )
  5783.             *
  5784.                   ENDIF
  5785.             *
  5786.                ENDPROC   StripPath
  5787.             *
  5788.             **************************************************************************
  5789.             *                       SendMLin -- Main Routine                         *
  5790.             **************************************************************************
  5791.             *
  5792.             *                                  Find out if we're in host mode
  5793.             *
  5794.                GetParam 'HP' HostMode
  5795.             *                                  Get port number
  5796.                GetParam 'PO' Port
  5797.             *                                  Get baud rate
  5798.                GetParam 'BA' BaudRate
  5799.             *                                  Get file spec
  5800.                GetParam 'FN' FileSpec
  5801.             *                                  Get host mode directory, and
  5802.             *                                  prepend to file spec, after
  5803.             *                                  stripping any other directory spec.
  5804.                IF ( HostMode = 'N' ) THEN
  5805.                   GetParam 'HD' UpDir
  5806.                   Call StripPath
  5807.                   Set FileSpec = CONCAT( UpDir , FileSpec )
  5808.                ENDIF
  5809.             *                                  Build MLink invocation line
  5810.             *
  5811.                Set Mlink = CONCAT( 'MLink port ' , Port )
  5812.                Set Mlink = CONCAT( CONCAT( Mlink , ' speed '  ), BaudRate )
  5813.                Set Mlink = CONCAT( CONCAT( Mlink , ' SM ' ), FileSpec )
  5814.             *
  5815.             *                                  Echo built line to screen
  5816.                Writeln " "
  5817.                Writeln "Invoking MLink as follows:"
  5818.                Writeln Mlink
  5819.                Writeln " "
  5820.             *                                  Echo Mlink line to capture file
  5821.             *
  5822.  
  5823.  
  5824.             PibTerm Script Language Reference Guide              Page 86
  5825.             PibTerm Script Language Reference Guide              Page 86
  5826.  
  5827.  
  5828.                Writelog "Invoking MLink as follows:"
  5829.                Writelog Mlink
  5830.             *                                  Call MLink
  5831.                Dos Mlink
  5832.             *
  5833.             
  5834.             
  5835.             Example: RECLINK.SCR for receiving files with MegaLink
  5836.             Example: RECLINK.SCR for receiving files with MegaLink
  5837.             
  5838.             Here is the script RECMLINK.SCR for interfacing MLINK.COM to
  5839.             PibTerm for  purposes  of  receiving  files  from  a  remote
  5840.             system:
  5841.             
  5842.             
  5843.             ***************************************************************************
  5844.             *       R E C M L I N K . S C R --- Script interfacing MLINK to PibTerm   *
  5845.             ***************************************************************************
  5846.             *                                                                         *
  5847.             *    Script:  RecMLink.Scr                                                *
  5848.             *                                                                         *
  5849.             *    Purpose: Interfaces external Megalink driver program MLINK.COM       *
  5850.             *             to PibTerm for receiving files.                             *
  5851.             *                                                                         *
  5852.             *    Invocation:                                                          *
  5853.             *                                                                         *
  5854.             *       Execute "RecMLink"                                                *
  5855.             *                                                                         *
  5856.             *    Remarks:                                                             *
  5857.             *                                                                         *
  5858.             *       This script is designed to be automatically invoked by the        *
  5859.             *       <ALT>R command when MegaLink has been defined as an external      *
  5860.             *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  5861.             *                                                                         *
  5862.             ***************************************************************************
  5863.             *                                                                         *
  5864.             *                                  Baud rate for transfer
  5865.                Declare BaudRate String
  5866.             *                                  Comm port number
  5867.                Declare Port     String
  5868.             *                                  Build Mlink invocation line in this
  5869.                Declare MLink    String
  5870.             *                                  Download directory
  5871.                Declare DownDir  String
  5872.             *                                  Length of download directory
  5873.                Declare L        Integer
  5874.             *                                  Host mode flag
  5875.                Declare HostMode String
  5876.             *                                  Find out if we're in host mode
  5877.             *
  5878.                GetParam 'HP' HostMode
  5879.             *                                  Get download directory.
  5880.             *                                  If in host mode, use host mode upload
  5881.             *                                  directory.
  5882.             *
  5883.  
  5884.  
  5885.             PibTerm Script Language Reference Guide              Page 87
  5886.             PibTerm Script Language Reference Guide              Page 87
  5887.  
  5888.  
  5889.                IF ( HostMode = ' ' ) THEN
  5890.                   GetParam 'DD' DownDir
  5891.                ELSE
  5892.                   GetParam 'HU' DownDir
  5893.                ENDIF
  5894.             *                                  Get port number
  5895.                GetParam 'PO' Port
  5896.             *                                  Get baud rate
  5897.                GetParam 'BA' BaudRate
  5898.             *                                  Strip final '\' if any from download dir
  5899.                Set L = LENGTH( DownDir )
  5900.             *
  5901.                IF ( Substr( DownDir, L, 1 ) = '\' ) THEN
  5902.                   Set DownDir = Substr( DownDir, 1, L - 1 )
  5903.                ENDIF
  5904.             *                                  Build Mlink invocation line
  5905.             *
  5906.                Set MLink = CONCAT( 'Mlink port ' , Port )
  5907.                Set MLink = CONCAT( CONCAT( MLink , ' speed ' ), BaudRate )
  5908.                Set MLink = CONCAT( CONCAT( MLink , ' rm ') , DownDir )
  5909.             *
  5910.             *                                  Echo MLink line to screen
  5911.                Writeln " "
  5912.                Writeln "Invoking MLink as follows:"
  5913.                Writeln MLink
  5914.                Writeln " "
  5915.             *                                  Echo MLink line to capture file
  5916.             *
  5917.                Writelog "Invoking MLink as follows:"
  5918.                Writelog MLink
  5919.             *                                  Call MLink
  5920.                Dos MLink
  5921.             *
  5922.             
  5923.             
  5924.             Example: SENDZMOD.SCR for sending files with Zmodem
  5925.             Example: SENDZMOD.SCR for sending files with Zmodem
  5926.             
  5927.             The PibTerm  release materials  already include a definition
  5928.             of Zmodem  as an  external file  transfer protocol using the
  5929.             batch files RECZMOD.BAT and SENDZMOD.BAT to invoke DSZ.COM.
  5930.                         RECZMOD.BAT     SENDZMOD.BAT                   
  5931.             
  5932.             As an  alternative, the  following presents send and receive
  5933.             scripts for use with DSZ.COM.
  5934.             
  5935.             Here the  script SENDZMOD.SCR  for  interfacing  DSZ.COM  to
  5936.             PibTerm for purposes of sending files to a remote system:
  5937.             
  5938.             
  5939.             ***************************************************************************
  5940.             *       S E N D Z M O D . S C R --- Script interfacing DSZ to PibTerm     *
  5941.             ***************************************************************************
  5942.             *                                                                         *
  5943.             *    Script:  SendZMod.Scr                                                *
  5944.             *                                                                         *
  5945.  
  5946.  
  5947.             PibTerm Script Language Reference Guide              Page 88
  5948.             PibTerm Script Language Reference Guide              Page 88
  5949.  
  5950.  
  5951.             *    Purpose: Interfaces external Zmodem driver program DSZ.COM           *
  5952.             *             to PibTerm for sending files.                               *
  5953.             *                                                                         *
  5954.             *    Invocation:                                                          *
  5955.             *                                                                         *
  5956.             *       Execute "SendZmod"                                                *
  5957.             *                                                                         *
  5958.             *    Remarks:                                                             *
  5959.             *                                                                         *
  5960.             *       This script is designed to be automatically invoked by the        *
  5961.             *       <ALT>R command when Zmodem has been defined as an external        *
  5962.             *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  5963.             *                                                                         *
  5964.             ***************************************************************************
  5965.             *                                                                         *
  5966.             *                                  File spec for files to transfer
  5967.                Declare  FileSpec String
  5968.             *                                  Baud rate for transfer
  5969.                Declare BaudRate String
  5970.             *                                  Comm port number
  5971.                Declare Port     String
  5972.             *                                  Zmodem block size
  5973.                Declare Block    String
  5974.             *                                  Build DSZ invocation line in this
  5975.                Declare Zmodem   String
  5976.             *                                  'restrict ' for host mode, else null
  5977.                Declare Restrict String
  5978.             *                                  Host mode flag
  5979.                Declare HostMode String
  5980.             *                                  Saves drive/directory we're in now
  5981.                Declare CurDrive String
  5982.                Declare CurDir   String
  5983.             *                                  Host mode download directory =
  5984.             *                                  directory remote callers can download from.
  5985.                Declare UpDir    String
  5986.             *                                  Length of directory name
  5987.                Declare L        Integer
  5988.             *                                  Get port number
  5989.                GetParam 'PO' Port
  5990.             *                                  Get baud rate
  5991.                GetParam 'BA' BaudRate
  5992.             *                                  Get Zmodem block size
  5993.                GetParam 'ZB' Block
  5994.                Set Block = '50'
  5995.             *                                  Get file spec
  5996.                GetParam 'FN' FileSpec
  5997.             *                                  Get host mode flag
  5998.                GetParam 'HP' HostMode
  5999.             *                                  Get directory we're in now
  6000.                GetDir CurDrive CurDir
  6001.             *                                  If host mode, move to host mode
  6002.             *                                  download directory and set restrict.
  6003.                Set Restrict = ''
  6004.             *
  6005.  
  6006.  
  6007.             PibTerm Script Language Reference Guide              Page 89
  6008.             PibTerm Script Language Reference Guide              Page 89
  6009.  
  6010.  
  6011.                IF ( HostMode <> ' ' ) THEN
  6012.             *
  6013.                   GetParam 'HD' UpDir
  6014.             *                                  Strip final '\' if any from download dir
  6015.                   Set L = LENGTH( UpDir )
  6016.             *
  6017.                   IF ( Substr( UpDir, L, 1 ) = '\' ) THEN
  6018.                      Set UpDir = Substr( UpDir, 1, L - 1 )
  6019.                   ENDIF
  6020.             *                                  Move to download dir
  6021.                   ChDir UpDir
  6022.             *                                  Set restrict if not super-user
  6023.                   IF ( HostMode <> 'S' ) THEN
  6024.                      Set Restrict = 'restrict '
  6025.                   ENDIF
  6026.             *
  6027.                ENDIF
  6028.             *                                  Build DSZ invocation line
  6029.             *
  6030.                Set Zmodem = CONCAT( 'DSZ port ' , Port )
  6031.                Set Zmodem = CONCAT( CONCAT( Zmodem , ' speed '  ), BaudRate )
  6032.                Set Zmodem = CONCAT( CONCAT( Zmodem , ' d z pL' ), Block )
  6033.                Set Zmodem = CONCAT( CONCAT( CONCAT( Zmodem , Restrict ), ' sz ' ), FileSpec )
  6034.             *
  6035.             *                                  Echo built line to screen
  6036.                Writeln " "
  6037.                Writeln "Invoking DSZ as follows:"
  6038.                Writeln Zmodem
  6039.                Writeln " "
  6040.             *                                  Echo Zmodem line to capture file
  6041.             *
  6042.                Writelog "Invoking DSZ as follows:"
  6043.                Writelog Zmodem
  6044.             *                                  Call DSZ
  6045.                Dos Zmodem
  6046.             *                                  Return to original directory if host mode
  6047.                IF ( HostMode <> ' ' ) THEN
  6048.                   Set CurDir = CONCAT( CONCAT( CurDrive , ':\' ), CurDir )
  6049.                   Chdir CurDir
  6050.                ENDIF
  6051.             
  6052.             
  6053.             Example: RECZMOD.SCR for receiving files with Zmodem
  6054.             Example: RECZMOD.SCR for receiving files with Zmodem
  6055.             
  6056.             Here is  the script  RECZMOD.SCR for  interfacing DSZ.COM to
  6057.             PibTerm for purposes of sending files to a remote system:
  6058.             
  6059.             
  6060.             ***************************************************************************
  6061.             *       R E C Z M O D . S C R --- Script interfacing DSZ to PibTerm       *
  6062.             ***************************************************************************
  6063.             *                                                                         *
  6064.             *    Script:  RecZMod.Scr                                                 *
  6065.             *                                                                         *
  6066.  
  6067.  
  6068.             PibTerm Script Language Reference Guide              Page 90
  6069.             PibTerm Script Language Reference Guide              Page 90
  6070.  
  6071.  
  6072.             *    Purpose: Interfaces external Zmodem driver program DSZ.COM           *
  6073.             *             to PibTerm for receiving files.                             *
  6074.             *                                                                         *
  6075.             *    Invocation:                                                          *
  6076.             *                                                                         *
  6077.             *       Execute "RecZmod"                                                 *
  6078.             *                                                                         *
  6079.             *    Remarks:                                                             *
  6080.             *                                                                         *
  6081.             *       This script is designed to be automatically invoked by the        *
  6082.             *       <ALT>R command when Zmodem has been defined as an external        *
  6083.             *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  6084.             *                                                                         *
  6085.             ***************************************************************************
  6086.             *                                                                         *
  6087.             *                                  Baud rate for transfer
  6088.                Declare BaudRate String
  6089.             *                                  Comm port number
  6090.                Declare Port     String
  6091.             *                                  Build DSZ invocation line in this
  6092.                Declare Zmodem   String
  6093.             *                                  Saves drive/directory we're in now
  6094.                Declare CurDrive String
  6095.                Declare CurDir   String
  6096.             *                                  Download directory
  6097.                Declare DownDir  String
  6098.             *                                  Length of download directory
  6099.                Declare L        Integer
  6100.             *                                  Host mode flag
  6101.                Declare HostMode String
  6102.             *                                  "Restrict" for host mode, else null
  6103.                Declare Restrict String
  6104.             *                                  Get directory we're in now
  6105.                GetDir CurDrive CurDir
  6106.             *                                  Get port number
  6107.                GetParam 'PO' Port
  6108.             *                                  Get baud rate
  6109.                GetParam 'BA' BaudRate
  6110.             *                                  Find out if we're in host mode
  6111.             *
  6112.                GetParam 'HP' HostMode
  6113.             *                                  Get download directory.
  6114.             *                                  If in host mode, use host mode upload
  6115.             *                                  directory.
  6116.             *
  6117.                Set Restrict = ''
  6118.             *
  6119.                IF ( HostMode = ' ' ) THEN
  6120.                   GetParam 'DD' DownDir
  6121.                ELSE
  6122.                   GetParam 'HU' DownDir
  6123.                   IF ( HostMode = 'N' ) THEN
  6124.                      Set Restrict = 'restrict '
  6125.                   ENDIF
  6126.  
  6127.  
  6128.             PibTerm Script Language Reference Guide              Page 91
  6129.             PibTerm Script Language Reference Guide              Page 91
  6130.  
  6131.  
  6132.                ENDIF
  6133.             *                                  Strip final '\' if any from download dir
  6134.                Set L = LENGTH( DownDir )
  6135.             *
  6136.                IF ( Substr( DownDir, L, 1 ) = '\' ) THEN
  6137.                   Set DownDir = Substr( DownDir, 1, L - 1 )
  6138.                ENDIF
  6139.             *                                  Move to download directory
  6140.                Chdir     DownDir
  6141.             *                                  Build DSZ invocation line
  6142.             *
  6143.                Set Zmodem = CONCAT( 'DSZ port ' , Port )
  6144.                Set Zmodem = CONCAT( CONCAT( Zmodem , ' speed ' ), BaudRate )
  6145.                Set Zmodem = CONCAT( CONCAT( CONCAT( Zmodem , ' d ' ), Restrict ), 'rz -y')
  6146.             *
  6147.             *                                  Echo Zmodem line to screen
  6148.                Writeln " "
  6149.                Writeln "Invoking DSZ as follows:"
  6150.                Writeln Zmodem
  6151.                Writeln " "
  6152.             *                                  Echo Zmodem line to capture file
  6153.                Writelog "Invoking DSZ as follows:"
  6154.                Writelog Zmodem
  6155.             *                                  Call DSZ
  6156.                Dos Zmodem
  6157.             *                                  Return to original directory
  6158.             *
  6159.                Set CurDir = CONCAT( CONCAT( CurDrive , ':\' ), CurDir )
  6160.             *
  6161.                Chdir CurDir
  6162.