home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 1 / AU_CD1.iso / internet / starterpak / !SLIPdial / !Help < prev    next >
Text File  |  1995-02-10  |  31KB  |  779 lines

  1. SLIPdial - a dialler for Archimedes !TCPIP               version 0.33
  2. ------------------------------------------
  3.  
  4. Slipdial is a script-driven dialler and general-control program for
  5. communications using !TCPIP. Its primary use is to initiate a connection
  6. with the network services provider (including dialling and logging-in)
  7. before handing over control to !TCPIP, and then to close down the connection
  8. cleanly when !TCPIP has finished. As well as the normal dialling and
  9. expect/send string functions for controlling your modem and negotiating a
  10. login, it also has many facilities to start and kill sub-tasks (both
  11. wimp-based and taskwindow-based); capturing and displaying messages from the
  12. remote computer; file handling; dialogue with the user; timer functions and
  13. more...
  14.  
  15. For example, you can define new icons to be added to the icon bar, which can
  16. have script-defined menus associated with them, as well as predefined
  17. actions for when the user clicks on them or drops a file on them.
  18.  
  19. Windows and controls
  20. --------------------
  21.  
  22. When slipdial starts, its icon appears on the icon bar. Clicking with SELECT
  23. on this icon opens the Status window, which tells you slipdial's state, and
  24. may allow selection of actions from a user-defined menu. You can also
  25. maximise this window, which gives you access to two extra controls -
  26. allowing you to pause, resume, or stop completely the current script.
  27.  
  28. If no script is loaded, either as a default or by the startup switches you
  29. used (see later), you can load and start one by dropping its file on the
  30. iconbar icon or on the status window. Most of the time, however, a script
  31. will be run automatically.
  32.  
  33. Clicking on the slipdial icon with the ADJUST button opens the Control
  34. window. This window displays the script as it executes, incoming text from
  35. the serial port, and other status information. At the bottom of this window
  36. is an input field, which allows you to directly enter slipdial commands.
  37.  
  38. Two menus are available from the Control window. Pressing MENU gives you the
  39. choice of listing various items - the script itself; the currently-defined
  40. menus; variables, tasks and alarms. Pressing MENU while holding down the
  41. CTRL key lets you change the current "Debug level". This controls how much
  42. information about script execution is displayed in the Control window (see
  43. the entry on the "debug" command for more information on the exact effects).
  44.  
  45. The other window available from the slipdial icon - actually from its
  46. associated menu - is the "Choices" window. With this you can specify which
  47. windows to open, how large to make them, and whether to run a specified
  48. script automatically (you can drag a file to the writable field to set
  49. this). These choices can be saved as default actions for every time you run
  50. slipdial.
  51.  
  52. The Status Window
  53. -----------------
  54.  
  55. If you have trouble getting slipdial to communicate with your modem, the
  56. status window contains some diagnotic aids in the form of 3 "LED's", in the
  57. lower right-hand corner of the window. These show the state of some of the
  58. more important serial control lines - from left to right: DTR (data terminal
  59. ready); CTS and CD (carrier detect). Of these, probably only DTR and CD are
  60. of very much interest - DTR indicates that the serial line is active and the
  61. modem is in a condition to be talked-to; while CD indicates that the modem
  62. is online and has established communication with the remote modem.
  63.  
  64. Startup flags
  65. -------------
  66.  
  67. To override the auto-run option, hold down the ALT key while starting
  68. SLIPdial.
  69.  
  70. Command-line startup flags include:
  71.  
  72. -file <filename>
  73.  runs a specified script file on startup. Example:
  74.    run Slipdial:!Run -file SLIPdial:call_demon
  75.  
  76. -quiet
  77.  pevents status and control windows from being opened at startup.
  78.  
  79. -auto
  80.  autoruns the script Slipdial:default
  81.  
  82. -sprite <size>
  83.  specifies size of slipdial's internal sprite area, for addition of user icons.
  84.  
  85. All startup flags/switches can be abbreviated to 1 significant character. For
  86. example:
  87.   run slipdial:!Run -s 8000 -f Slipdial:call_demon
  88.  
  89. Script language
  90. ---------------
  91.  
  92. There's no consistancy to what's in the language; just whatever I thought
  93. might be useful. The language has evolved to be something like VMS DCL, in
  94. that commands are often modified by qualifiers (command/qualifier=value).
  95. It's even similar to DCL in its extreme lethargy of execution!
  96.  
  97. One useful point to know is that the first line of a script MUST be:
  98. #slipdial
  99.  
  100. and another is that that scriptfiles must have the "Text" filetype. The
  101. "#slipdial" comment at the start of the file prevents slipdial from
  102. attempting to load non-script textfiles.
  103.  
  104. Events
  105. ------
  106.  
  107. Certain commands set up actions with may occur asynchronously, meaning they
  108. don't follow the normal flow of the script. These could include timed
  109. alarms, user menu selections, line-condition alarms, etc. For the sake of
  110. giving these a name, I shall call these "events". Though they can be a
  111. little hard to understand at first (they can make it hard to understand the
  112. "flow" of your script), many of the most useful script capabilities center
  113. around them.
  114.  
  115. SLIPdial script syntax
  116. ----------------------
  117.  
  118. Many slipdial commands can take qualifiers, which alter their behaviour
  119. in some way. Command qualifiers are introduced with a slash (/) and may in
  120. some cases be followed by a value after an equals sign.
  121.  
  122. Parameters and qualifiers are generally space-delimited - if you wish to
  123. include spaces, the parameter or qualifier should be enclosed in quotation
  124. marks.
  125.  
  126. Multiple commands on a line are separated with the ";" character.
  127.  
  128. Commands may be continued across lines by using a trailing "-".
  129.  
  130. Characters with special meaning may be escaped with the "\" character to
  131. prevent their interpretation. Special characters include:
  132.  /      introduces qualifier
  133.  space  separates command components
  134.  "      encloses components to prevent splitting
  135.  ;      separates commands on a line
  136.  %      introduces script variable
  137.  \      the escape character itself
  138.  
  139. Remember to use extra escape characters in lines which may be expanded more
  140. than once. For example, the line:
  141.  alarm/icon=test "message \\%$file \\%$type"
  142. needs two escape characters to quote the variables, as they are expanded
  143. once upon setting the alarm, then again on alarm execution. Unfortunately,
  144. the number of escape characters needed in any relatively complex situation
  145. like this may not make sense, and should probably be subject to
  146. experimentation! A later version of the script interpreter may do a better
  147. job here...
  148.  
  149. The values of script variables may be substituted into lines by prefixing
  150. them with a "%". For example, after the command "set test hello", the
  151. command "message %test" expands into "message hello".
  152.  
  153. The output of another command can also be substituted into a line. To do
  154. this, the command is enclosed in curly brackets {,}. The return value of the
  155. enclosed command will be substituted in its place. For example:
  156.  set test {?file slipdial:!run}
  157. expands to:
  158.  set test 1
  159. (assuming the file 'slipdial:!Run' has an object type of 1).
  160. Another example:
  161.  message {icon/free}
  162. displays the number of free bytes in the slipdial sprite area in a window.
  163.  
  164. Slipdial script commands
  165. ------------------------
  166. 1: General
  167. ----------
  168.  
  169. # comment
  170.  introduces a comment - the line is ignored (and, in fact, not loaded).
  171.  
  172. debug <n>
  173.  sets debugging level - controls what level of information is sent to the
  174.  control window and debug file (if any).
  175.    0 no debug output
  176.    1 script progress
  177.    2 text received from modem
  178.    3 log both text & script
  179.  
  180. echo [/status] [/date] <string>
  181.  echoes a string (or set of strings) to the control window (default)
  182.   or the status window.
  183.  /date adds the current date to the string before writing.
  184.  
  185. set <variable> <value> [<variable> <value> ... ]
  186.  assigns a value to a script variable. <value> should be quoted if it
  187.  includes spaces. More than one variable/value pair may be set at once.
  188.  
  189. unset <variable>
  190.  deassigns a script variable.
  191.  
  192. ?eq <variable> <variable|value>
  193. ?ne <variable> <variable|value>
  194. ?lt <variable> <variable|value>
  195. ?le <variable> <variable|value>
  196. ?gt <variable> <variable|value>
  197. ?ge <variable> <variable|value>
  198.  these test whether a variable is equal, unequal, greater, or less
  199.  than, another variable or value. Return 1 or 0 for true/false.
  200.  
  201. eval <expression>
  202.  returns result of mathematical operations (possibly on script variables).
  203.  eg: set lemming {eval "%lemming + 1"}
  204.    increments the value of 'lemming' by one.
  205.  
  206. string /size <string>
  207.  returns size (length) of a string.
  208. string /upper <string>
  209.  converts string to upper case
  210. string /lower <string>
  211.  converts string to lower case
  212. string /right=<n> <string>
  213.  returns rightmost <n> characters of string
  214. string /left=<n> <string>
  215.  returns leftmost <n> characters of string
  216. string /start=<n> /length=<n>
  217.  extracts a substring from a string
  218. string/instr=<string2> <string1>
  219.  returns position of <string2> in <string1>
  220.  
  221. oscli <os command> [<os command> ... ]
  222.  executes RISC OS commands. Return 1/0 for success/error.
  223.  
  224. message [/id=<n>] [/add] [/title=<title>] [/capture[=<string>]] [/end=<string>]
  225.         [/max=<n>] [/wait] <line1> [<line2> ... ]
  226.  opens a window with a textual message for the user. Each line should be
  227.    enclosed in quotes.
  228.  /id=<n>  identifies which message window the command applies to. At
  229.           present there is only one window, and this qualifier is ignored.
  230.           The ability to specify multiple windows will be added in
  231.           later versions.
  232.  /wait    qualifier pauses script until user clicks on OK icon or closes
  233.           message window.
  234.  /capture[=<string>] will capture serial input to the message window, 
  235.           optionally starting from <string>. (See Notes at end)
  236.  /end=<string> causes message capture to end when <string> is found.
  237.  /max=<n> defines a maximum number of lines to capture.
  238.  /add     causes text to be added to an existing message. If no text
  239.           is given, the command simply forces an update (redraw) of the
  240.           message window.
  241.  
  242. message [/id=<id>] /close
  243.  explicitly closes any message window.
  244.  
  245. ask [/delay=<n>] [/default=<yes|no>] <question>
  246.  brings up a window asking for a yes/no answer from the user. Returns 1
  247.  if 'yes' is clicked; 0 if 'no' is clicked.
  248.  /delay=<n>     sets timeout (in seconds). If no response is received
  249.                 within this time, the default answer is returned.
  250.  /default=<y|n> sets the default answer returned if the command times
  251.                 out. If unspecified, 'no' (0) is assumed. Note that, at
  252.                 present, the default answer is not highlighted in any
  253.                 way on the dialogue window.
  254.  
  255. ?task <taskname>
  256.  returns task handle of task, or zero if it is not running.
  257.  
  258. error <message>
  259.  stops the script with an error message (and invokes error handler, if any
  260.  is installed.
  261.  
  262. help [<command>]
  263.  gives online help about script commands. "help" by itself gives a list
  264.  of available help topics.
  265.  
  266. newsrate <abbr>
  267.  computes the transfer rate of news from the time difference between
  268.  the xxxNews and xxxNG files, eg: newsrate Dem
  269.  Returns a value in characters per second.
  270.  
  271. 2: Script Flow
  272. --------------
  273.  
  274. :<label>
  275.  marks a label in the script; a destination for 'goto' or 'call'. Spaces
  276.  should not be used in a label definition.
  277.  
  278. goto <label>
  279.  transfers execution to the line following the given label.
  280.  
  281. call [/lock] <label> [<parameters>]
  282.  calls a subroutine, with optional parameters. The parameters are
  283.  placed into the script variables p1,p2,...,pn within the subroutine.
  284.  The /lock flag sets a 'lock flag' on the subroutine, which prevents it
  285.  from being re-entered until it has returned.
  286.  
  287. return [<value>]
  288.  return from subroutine, optionally passing back a return value. The returned
  289.  value may be numeric or textual.
  290.  
  291. if (<command>) <command>
  292.  conditionally executes a command depending on the status returned from
  293.  another command. For example:
  294.  if (?file $.lemming) exit
  295.   exits the script if the file $.lemming exists. You can also negate the test:
  296.   if (!?file $.lemming) exit
  297.  
  298. case <value|variable>
  299.  starts a case...when...endcase structure.
  300.  
  301. when <value> [<value> ... ] ; <commands>
  302.  executes the remainder of the line if one of values matches the current
  303.   "case" value. Note this only acts on the rest of the same line containing
  304.   the "when" statement.
  305.  
  306. endcase
  307.  marks the end of a case...when...endcase structure.
  308.  
  309. library <filename> [<parameters> ... ]
  310.  appends a script file to the current script for use as a library. If the
  311.  new file contains a subroutine "autoexec", it will be executed after
  312.  loading, being passed the parameters given in the library command.
  313.  
  314. source <filename>
  315.  directly executes script commands from the given file.
  316.  
  317. chain <filename>
  318.  loads and runs a new script. All variable (except for 'system' variables,
  319.  beginning with "$"), alarms, menus, etc are cleared. The name of the
  320.  original script is placed in the system variable "$caller".
  321.  
  322. exit
  323.  stops the script.
  324.  
  325. quit
  326.  stops the script and quit the program.
  327.  
  328. stop
  329.  simulates pressing the 'stop' button.
  330.  
  331.  
  332. 3: Serial i/o
  333. -------------
  334.  
  335. driver [<name>]
  336.  loads a modem driver, or sets the default (internal) driver if unspecified.
  337.  Modem drivers define the strings used to control the modem, and the status
  338.  messages returned from them.
  339.  
  340. port <driver> <port number>
  341.  loads the specified block driver, and use specified port number. For
  342.  example:
  343.   port sp_dual 1
  344.  If not specified, "port internal 0" is assumed.
  345.  
  346. speed <baud>
  347.  sets baud rate to <baud>. Default is 19200.
  348.  
  349. claim [<attempts> [<delay>]]
  350.  claims the currently selected port and initialise it, with optional retries
  351.  if the port is unavailable. Returns 1/0 for success/failure
  352.  
  353. release
  354.  releases port (also dropping line).
  355.  
  356. init [<string>]
  357.  drops and raises DTR on serial port to put modem in command mode, and sends
  358.  the specified string to the modem; then waits for "OK". Returns 1/0 for
  359.  success/failure.
  360.  If no string is given, the init strings from the modem driver are sent.
  361.  
  362. reinit
  363.  resets serial port.
  364.  
  365. retry [<attempts> [<delay>]]
  366.  sets default number of dialling retries and intervening delay, in seconds.
  367.  
  368. dial [/pulse] [/retry=<n>] [/delay=<n>] [/nodial=<n>] [/nocar=<n>]
  369.         [/busy=<n>] <number> [<number> ... ]
  370.  dials the specified number or list of numbers. If a list is given, a number
  371.  will be tried multiple times (specified by 'retry') before moving on to the
  372.  next in the list. Returns 1/0 for success/failure.
  373.  /pulse uses pulse dialling instead of tone.
  374.  /delay=<n> and /retry=<n> override the default number of retries and delay.
  375.  /nodial=<n>, /nocar=<n> and /busy=<n> override default redial delays for
  376.  individual cases (ie, no dialtone, no carrier, busy). Useful, eg, to
  377.  specify a longer delay for no dialtone (someone using phone).
  378.  
  379. send [/raw] [/noraw] [name=<id>] <string> [<string> ... ]
  380.  sends a string to the serial port or a taskwindow.
  381.  /raw           prevents a newline.
  382.  /noraw         renables newlines.
  383.  /name=<id>     sends the string to taskwindow <id> rather than the serial
  384.                 port.
  385.  
  386. ?line <condition>
  387.  tests condition of serial port lines. Condition can be one of:
  388.   /cts
  389.   /dsr
  390.   /rng
  391.   /dcd
  392.   Returns 1/0 for high/low
  393.  
  394. 4: Control
  395. ----------
  396.  
  397. wait [/delay=<n>] [/id=<id>] <string1> [<string2>...]
  398.  waits for a string to be received. You can specify up
  399.  to 4 strings to wait for. For example:
  400.  wait login password
  401.   returns 1 if "login" is detected, 2 if "password" is detected, or 0 if the
  402.   command times out.
  403.   The default timeout is 600 seconds (10 minutes); you can alter this with
  404.   the /delay=<n> qualifier. For example:
  405.   wait /delay=20 login
  406.    waits for 20 seconds for the string "login".
  407.  To include spaces in a wait string, quote the string - eg:
  408.   wait /delay=20 login "contrived example" HELLO
  409.  
  410.  The default input stream examined is the serial (or other) port, as defined
  411.   by the "port" command. If the qualifier "/id=<id>" is specified, the
  412.   output stream from the specified taskwindow is examined instead. Note that
  413.   you can at present only specify a taskwindow which is being buffered to a
  414.   window; not one with output to a file.
  415.                                   
  416. wait /event
  417.  waits for an event such as an alarm or a user menu selection.
  418.  
  419. event [/enable|/disable] <event-type> [<event-type> ... ]
  420.  enables or disables events. You might want to disable events during
  421.  sensitive script operations, such as logging in. Events will still be queued
  422.  while disabled, but will not be acted upon until an "event/enable" is issued.
  423.  Note that "stop" and "error" events cannot be disabled!
  424.  Event types are as follows:
  425.    sys    slipdial system events (cannot be disabled)
  426.    time   timed alarms
  427.    line   line alarms
  428.    task   task termination events
  429.    twin   taskwindow termination events
  430.    input  user command input (command window)
  431.    icon   click on user icons
  432.    file   file dropped on user icons
  433.    menu   user-defined menus
  434.    eof    user-file EOF events
  435.  Event specifications may be combined in one command, eg:
  436.    event /disable all /enable line menu task
  437.  
  438. alarm /time=<time> [/repeat] [/id=<id>] <action>
  439.  sets an alarm either for time-of-day or elapsed time. <time> is specified as:
  440.    HH:MM:SS     time of day
  441.   +HH:MM:SS     elapsed time
  442.  The /repeat qualifier will resubmit the same alarm setting  after it goes off.
  443.  The /id qualifier associates a name with an alarm, so it can be cancelled.
  444.  
  445. alarm /cancel=<id>
  446.  Cancels a timed alarm. (to cancel a non-timed alarm such as /stop or /dcd,
  447.  set the alarm with a null command - eg, 'alarm/stop').
  448.  
  449. alarm /stop=<command>
  450.  Specifies a command to be executed when the "Stop" button is clicked. If no
  451.  stop alarm is defined, the serial device is released and the script pauses.
  452.  This alarm cancels itself when it goes off.
  453.  
  454. alarm /dcd[=0|1] <command>
  455. alarm /cts[=0|1] <command>
  456. alarm /dtr[=0|1] <command>
  457. alarm /rng[=0|1] <command>
  458. alarm /dsr[=0|1] <command>
  459.  Specifies command to execute when the specified line becomes low (or high).
  460.  This alarm cancels itself when it goes off. Use the '=1' value specification
  461.  to trigger on low->high, otherwise, triggers on high->low.
  462.  
  463. alarm/error=<command>
  464.  defines command to execute when a script error occurs.
  465.  
  466. alarm/icon=<id> <command>
  467.  defines command to execute when a file is dropped onto icon with identifier
  468.  <id>. The name of the file dropped is put into the variable $file, and its
  469.  filetype (in hex) into $type.
  470.  
  471. menu "entry:command" ["entry:command"]...
  472.  defines a user menu (only acted upon during a "wait /event")
  473.  For example:
  474.  menu "Call Demon:call calldemon" "Send Mail:call sendmail" "Quit:quit"
  475.  
  476. menu/icon=<id> "entry:command" ["entry:command"]...
  477.  defines a menu associated with an iconbar icon (added by the 'icon'
  478.  command).
  479.  
  480. icon/id=<id> [/file=<filename>] [/action=<command>] <spritename>
  481.  adds an icon to the icon bar. Up to 5 extra icons can be added, each with
  482.  their own associated actions and menus.
  483.  /id=<id> identifies the icon (either a new icon or replacement)
  484.  /file=<filename> loads the named sprite file into slipdial's sprite pool
  485.         (note, limited space available!)
  486.  /action=<command> defines script command to execute when icon is clicked.
  487.  
  488. icon/cancel=<id> deletes an icon from the iconbar.
  489.  
  490. icon /free returns the amount of free space in the slipdial sprite area. This
  491.  can be used to check whether it is possible to load a sprite file.
  492.  
  493. pause <n>
  494. sleep <n>
  495.  Waits for <n> seconds before continuing script execution.
  496.  If <n> is zero or omitted, puts script into pause mode (restart 
  497.  by clicking on Resume).
  498.  
  499. task [/name=<name>] [/exit=<command>] [/wait] <filespec>
  500.  starts the specified task. Example:
  501.  task <TCPIP$Dir>.!Run
  502.  /name  specifies a name to be associated with the command (by which it may
  503.  be killed, for example).
  504.  /exit  specifies a command to be executed when the task terminates.
  505.  /wait  forces the script to wait for the started task to finish. Otherwise,
  506.   script execution continues as soon as the task starts (the "/exit" command,
  507.   if any, being added to the event queue when the task finishes).
  508.  It is possible to combine the "/wait" and "/exit" qualifiers, but also
  509.  pointless!
  510.  
  511. task /kill[=<taskname>]
  512.  task /kill by itself kills the last task to be started by the "task" command.
  513.  task /kill <taskname> kills a task by name (name as known by the task
  514.   manager). Only tasks known to SLIPdial (started by the "task" command) can
  515.   be killed.
  516.  
  517. taskwindow [/name=<name>] [/size=<nK>] [/exit=<command>] [/wait] [/keep]
  518.                 [/output=<filename>] "<external command>"
  519.  Starts a taskwindow process.
  520.  /name  name for task manager (default is "SDtaskn", where n is a number).
  521.  /size  sets wimpslot size for task (default is size of "Next" slot).
  522.  /exit  defines command to execute when task terminates
  523.  /output    sets file to store output in (if no file specified, all output
  524.         goes to a buffer window).
  525.  /nooutput  prevents an output window from being opened, though the data
  526.         is still buffered internally as if a window were present.
  527.  /wait  forces the script to wait for the started task to finish. Otherwise,
  528.         script execution continues as soon as the task starts (the "/exit"
  529.         command, if any, being added to the event queue when the task
  530.         finishes).
  531.  /keep  causes the buffer window, if any, to be kept onscreen after the
  532.         task finishes. Otherwise, the window is deleted as the task exits.
  533.         The slipdial taskwindow "slot" cannot be re-used until the window
  534.         is closed.
  535.  It is possible to combine the "/wait" and "/exit" qualifiers, but also
  536.  pointless!
  537.  
  538. taskwindow /kill=<id>
  539.  kills the given taskwindow.
  540.  
  541. taskwindow /suspend=<id>
  542. taskwindow /resume=<id>
  543.  these commands suspend or resume a taskwindow.
  544.  
  545. dataopen <taskname> <filespec>
  546.  sends a dataopen message for the specified file to the specified task.
  547.  
  548. ipget [/delay=<n>] <string>
  549.  waits for <string>, which should mark the start of a dynamically-assigned
  550.  IP number. The rest of the number will then be captured. Example:
  551.    ipget 134.
  552.  The string:
  553.    Your IP address is 134.84.101.42.
  554.  is received. The IP number 134.84.101.42 is captured, into the script variable  "ipaddress", for use by the "make" or other commands. The variables ip1, ip2,
  555.  ip3 amd ip4 are also set, to the four components of the IP address.
  556.  
  557.  The /delay qualifier sets the command timeout in seconds. If not specified,
  558.  a timeout of 60 seconds is assumed.
  559.  
  560. make <source> <dest>
  561.  Makes one file from another, performing variable substitutions. For example,
  562.  to create an Autoexec file for !TCPIP. Occurances of "%variable" in the
  563.  source file are replaced by the variable value in the output file. Eg:
  564.     ip address [%ipaddress]
  565.     attach asy %port slip ax0 4096 576 %speed
  566.     route add default ax0 [%ip1.%ip2.%ip3.254] 1
  567.  becomes:
  568.     ip address [134.84.101.42]
  569.     attach asy sp_dual 1 slip ax0 4096 576 57600
  570.     route add default ax0 [134.84.101.254] 1
  571.  
  572.  Specifying output file contents within scripts:
  573.  You can take lines from the script as well as from an input file. Script
  574.  lines following the "make" command which have a "+" as the first character
  575.  will be used as source lines for the output file (the + character being
  576.  stripped off). Specify an input file of "-" to use only these script lines.
  577.  If you specify both a real input file and + lines, the + lines will be used
  578.  after the input file has been processed.
  579.  
  580.  Comment lines (those beginning with a "#") in the source file are not
  581.  transferred to the output file.
  582.  
  583. list /var
  584. list /tasks
  585. list /menus
  586. list /script [<first> [<last>]]
  587. list /alarms
  588. list /files
  589.  Lists current variables, tasks, menus, script, alarms, or open userfiles
  590.  to the debug window.
  591.  
  592. ?free [/mem] [/next] [/free] [/device=<filespec>] [/int]
  593.  returns amount of free memory:
  594.  /mem   returns all free memory, ie next+free slots
  595.  /next  returns size of 'next' slot
  596.  /free  returns size of 'free' slot
  597.  /device    returns amount of space left on the device holding <filespec>
  598.  /internal  returns internal free space within slipdial application
  599.  
  600. input [/prompt=<prompt>] <variable> [[/prompt=<prompt2>] <variable2> ... ]]
  601.  Prompts the user for input in a window, and place the input in a script
  602.  variable. Multiple prompts/inputs can be combined in one command.
  603.  
  604.  
  605. 5: File commands
  606. ----------------
  607.  
  608. move <file1> <file2>
  609.  moves a file from one location to another.
  610.  (a rename is tried first; if that fails, a copy with source delete is tried).
  611.  
  612. copy [/head=<n> /tail=<n>] <file1> <file2>
  613.  copies one file to another.
  614.  With either the /head or /tail qualifier, copies only the first or last <n>
  615.   lines of the file. If <n> is unspecified, a default of 50 is used.
  616.  
  617. For both move and copy, a '*' within the destination filename is replaced
  618. with a 4-digit random number such that the destination file is guaranteed
  619. unique. The created destination filename is also stored in the script
  620. variable '$dest', for later reference.
  621.  
  622. append <file1> <file1>
  623.  appends file1 to file2 (if file2 doesn't exist, it is created).
  624.  
  625. delete <file>
  626.  deletes a file.
  627.  
  628. ?file <filename>
  629.  ?file itself returns object type of file
  630.    0 doesn't exist
  631.    1 file
  632.    2 directory
  633.    3 image file
  634.  Other qualifiers available:
  635.  /size    returns the size (in bytes) of the given object.
  636.  /type    returns the (hex) filetype.
  637.  /attrib  returns the file attributes (bit 0 = read access, etc).
  638.  /expand  returns the canonicalised filename.
  639.  /leaf    returns the leafname of <filename>.
  640.  /path    returns the path component of <filename>.
  641.  
  642. trace <filename>
  643.  opens <filename> as a debugging logfile. All output which appears in the
  644.  debug window is also sent here. (currently excepting taskwindow output).
  645.  
  646. open /id=<id> [/error=<command>] [/read|/write|/rw] <filename>
  647.  Opens the named file for read, write or read-write access, associating the
  648.  given identifier with the file.
  649.  The /error qualifier defines a command to execute if the file open fails.
  650.  
  651. close /id=<id>
  652.  Closes the file with the given identifier.
  653.  
  654. read /id=<id> [/eof=<command>] <variable> [<variable> ... ]
  655.  Reads lines from the given file into script variables.
  656.  The /eof qualifier defines a command to execute if end-of-file
  657.   is reached during the read oeration.
  658.  
  659. write /id=<id> <data> [<data> ... ]
  660.  Writes textual data into the given file.
  661.  
  662. ptr /id=<id> [/set=<n>] [<variable>]
  663.  Reads or sets the pointer into the named file.
  664.  Without the "/set" qualifier, returns the file pointer (optionally setting
  665.  the named variable).
  666.  With the /set qualifier, sets the file pointer.
  667.  "/set=eof" sets the pointer to end-of-file.
  668.  
  669.  
  670. 6: Script Variables
  671. -------------------
  672.  
  673. Variable substitution takes place on each line in the script during
  674. execution. A variable is specified by the prefix "%"; for example:
  675.  set lemming goto start
  676.  %lemming
  677. would execute the command "goto start".
  678.  
  679. Some variables are defined automatically during script execution. These are:
  680.  
  681. $status
  682.  contains values returned from script commands, often indicating success
  683.  or failure, but can indicate more detailed results.
  684.  
  685. port
  686.  contains driver and port in use (set by "port" command)
  687.  
  688. speed
  689.  contains baud rate (set by "speed" command)
  690.  
  691. ipaddress
  692.  contains IP address detected by "ipget" command. Setting this variable causes
  693.  automatic recalculation of the variables ip1,ip2,ip3,ip4, and updates the
  694.  "IP" address field in the status window.
  695.  
  696. ip1,ip2,ip3,ip4
  697.  contain the four components of a detected IP address.
  698.  
  699. route
  700.  set to %ip1.%ip2.%ip3.254 by "ipget", but you can of course alter it
  701.  yourself.
  702.  
  703. p1 p2 p3 (etc)
  704.  parameters passed to a subroutine. Note these are NOT preserved throughout
  705.  the execution of the subroutine and will be destroyed by further calls to
  706.  other routines. Transfer values to variables of your own if you want to
  707.  keep them for later use.
  708.  
  709. 7: Notes
  710. --------
  711.  
  712. Alarm scheduling is done using OS_ReadMonotonicTime. Things may (certainly
  713. will!) break when the timer wraps around to a negative value. Will possibly
  714. be fixed someday, but not terribly likely!
  715.  
  716. Some functions operate in slightly unexpected ways. The correct way to use
  717. the "message/capture" command is not obvious, for example. It does not, in
  718. fact, examine the serial input stream itself at all; but merely installs a
  719. "filter". For text to be captured, you then need to use a command which does
  720. examine the input stream - examples being "wait", "ipget", etc.
  721. To avoid flicker, the message window is not updated on every captured line.
  722. Instead, it gets refreshed whenever a blank line is received. A four-second
  723. timer also causes a refresh if the contents change but the window is not
  724. updated for that long.
  725. An update can be forced by adding a blank line to the window: "message/add".
  726. Blank lines are not added to the display list; they simply cause a refresh.
  727.  
  728. "task/exit" and "taskwindow/exit" also need some explanation. These commands
  729. enable another script command to be executed when the started task finishes.
  730. How this operates is to add the "exit command" to the event queue when task
  731. termination is detected. After the "task/exit" command, script execution
  732. continues immediately after the task starts; the exit command, therefore,
  733. can be triggered at any future point in the script. For most simple
  734. commands, or even most subroutine calls, this presents no problem, but
  735. obviously "goto" commands and suchlike should probably be avoided. For
  736. particulary critical routines, where the execution of a lengthy
  737. event-command could disrupt things - for example, during a login sequence -
  738. event processing can be disabled, using the "event/disable[=<type>]"
  739. command.
  740.  
  741. The script can stay in the dialling routine for a relatively long time.
  742. During this time, events (alarms, menus, etc) are not acted upon.
  743.  
  744. Currently hard-coded limits are:
  745. Script line limit               2000 (but memory management may not
  746.                                 cope with a script this size, at present!)
  747. Items per user menu             30 (255 character limit total for each
  748.                                     of description & command lists)
  749. Timed alarms                    10
  750. Simultaneous tasks              8       ('task' command)
  751. Simultaneous taskwindows        8       ('taskwindow' clients)
  752. Variables                       100
  753. Goto/call destinations          50
  754. Subroutine levels               20
  755. Case...when...endcase levels    10
  756. Simultaneous 'wait' strings     4
  757. Pending events                  10
  758. Open "user" files               10
  759. User icons                      8
  760.  
  761. ----------------------------------------------------------------------------
  762. Disclaimer!
  763. -----------
  764.  
  765. SLIPdial is probably still full of bugs. Most things seem to work okay, but
  766. the increasing complexity of the script language makes exhaustive checking
  767. difficult. However, I should thank several people for testing slipdial
  768. during the rapidly-changing versions between 0.23 and 0.30:-
  769. Robert Orwin    rob@wong.demon.co.uk
  770. Ian Stocks      ian@frogstar.demon.co.uk
  771. Andrew Black    andrew@bach.demon.co.uk
  772. Paul Allen      pla@sktb.demon.co.uk
  773. Rick Hewitt     rick@chocky.demon.co.uk
  774. also many others who pointed out bugs or made suggestions.
  775.  
  776. Any problems, suggestions or questions can be sent to me via email at:
  777.  
  778. allan@mnhep1.hep.umn.edu, or allan@mnhepz.hep.umn.edu
  779.