home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
internet
/
starterpck
/
!SLIPdial
/
!Help
< prev
next >
Wrap
Text File
|
1995-04-09
|
32KB
|
798 lines
SLIPdial - a dialler for Archimedes !TCPIP version 0.34
------------------------------------------
Slipdial is a script-driven dialler and general-control program for
communications using !TCPIP. Its primary use is to initiate a connection
with the network services provider (including dialling and logging-in)
before handing over control to !TCPIP, and then to close down the connection
cleanly when !TCPIP has finished. As well as the normal dialling and
expect/send string functions for controlling your modem and negotiating a
login, it also has many facilities to start and kill sub-tasks (both
wimp-based and taskwindow-based); capturing and displaying messages from the
remote computer; file handling; dialogue with the user; timer functions and
more...
For example, you can define new icons to be added to the icon bar, which can
have script-defined menus associated with them, as well as predefined
actions for when the user clicks on them or drops a file on them.
Windows and controls
--------------------
When slipdial starts, its icon appears on the icon bar. Clicking with SELECT
on this icon opens the Status window, which tells you slipdial's state, and
may allow selection of actions from a user-defined menu. Four icons down the
right side of the window give access to a menu, perform a redial (if
dialling), pause/unpause the script, or stop the script.
If no script is loaded, either as a default or by the startup switches you
used (see later), you can load and start one by dropping its file on the
iconbar icon or on the status window, or you can select one from the status
window menu. Most of the time, however, a script will be run automatically.
Clicking on the slipdial icon with the ADJUST button opens the Control
window. This window displays the script as it executes, incoming text from
the serial port, and other status information. At the bottom of this window
is an input field, which allows you to directly enter slipdial commands.
Two menus are available from the Control window. Pressing MENU gives you the
choice of listing various items - the script itself; the currently-defined
menus; variables, tasks and alarms. Pressing MENU while holding down the
CTRL key lets you change the current "Debug level". This controls how much
information about script execution is displayed in the Control window (see
the entry on the "debug" command for more information on the exact effects).
The other window available from the slipdial icon - actually from its
associated menu - is the "Choices" window. With this you can specify which
windows to open, how large to make them, and whether to run a specified
script automatically (you can drag a file to the writable field to set
this). These choices can be saved as default actions for every time you run
slipdial.
The Status Window
-----------------
If you have trouble getting slipdial to communicate with your modem, the
status window contains some diagnotic aids in the form of 3 "LED's", in the
lower right-hand corner of the window. These show the state of some of the
more important serial control lines - from left to right: DTR (data terminal
ready); CTS and CD (carrier detect). Of these, probably only DTR and CD are
of very much interest - DTR indicates that the serial line is active and the
modem is in a condition to be talked-to; while CD indicates that the modem
is online and has established communication with the remote modem.
Startup flags
-------------
To override the auto-run option, hold down the ALT key while starting
SLIPdial.
Command-line startup flags include:
-file <filename>
runs a specified script file on startup. Example:
run Slipdial:!Run -file SLIPdial:call_demon
-quiet
pevents status and control windows from being opened at startup.
-auto
autoruns the script Slipdial:default
-sprite <size>
specifies size of slipdial's internal sprite area, for addition of user icons.
All startup flags/switches can be abbreviated to 1 significant character. For
example:
run slipdial:!Run -s 8000 -f Slipdial:call_demon
Script language
---------------
There's no consistancy to what's in the language; just whatever I thought
might be useful. The language has evolved to be something like VMS DCL, in
that commands are often modified by qualifiers (command/qualifier=value).
It's even similar to DCL in its extreme lethargy of execution!
One useful point to know is that the first line of a script MUST be:
#slipdial
and another is that that scriptfiles must have the "Text" filetype. The
"#slipdial" comment at the start of the file prevents slipdial from
attempting to load non-script textfiles.
Events
------
Certain commands set up actions with may occur asynchronously, meaning they
don't follow the normal flow of the script. These could include timed
alarms, user menu selections, line-condition alarms, etc. For the sake of
giving these a name, I shall call these "events". Though they can be a
little hard to understand at first (they can make it hard to understand the
"flow" of your script), many of the most useful script capabilities center
around them.
SLIPdial script syntax
----------------------
Many slipdial commands can take qualifiers, which alter their behaviour
in some way. Command qualifiers are introduced with a slash (/) and may in
some cases be followed by a value after an equals sign.
Parameters and qualifiers are generally space-delimited - if you wish to
include spaces, the parameter or qualifier should be enclosed in quotation
marks.
Multiple commands on a line are separated with the ";" character.
Commands may be continued across lines by using a trailing "-".
Characters with special meaning may be escaped with the "\" character to
prevent their interpretation. Special characters include:
/ introduces qualifier
space separates command components
" encloses components to prevent splitting
; separates commands on a line
% introduces script variable
\ the escape character itself
Remember to use extra escape characters in lines which may be expanded more
than once. For example, the line:
alarm/icon=test "message \\%$file \\%$type"
needs two escape characters to quote the variables, as they are expanded
once upon setting the alarm, then again on alarm execution. Unfortunately,
the number of escape characters needed in any relatively complex situation
like this may not make sense. Where this proves to be a problem, the command
may be preceded by the "literal" command to prevent any interpretation of
special characters (such as % or \) in that command. This is particularly
useful in setting variables for modem initialisation strings.
The values of script variables may be substituted into lines by prefixing
them with a "%". For example, after the command "set test hello", the
command "message %test" expands into "message hello".
The output of another command can also be substituted into a line. To do
this, the command is enclosed in curly brackets {,}. The return value of the
enclosed command will be substituted in its place. For example:
set test {?file slipdial:!run}
expands to:
set test 1
(assuming the file 'slipdial:!Run' has an object type of 1).
Another example:
message {icon/free}
displays the number of free bytes in the slipdial sprite area in a window.
Slipdial script commands
------------------------
1: General
----------
# comment
introduces a comment - the line is ignored (and, in fact, not loaded).
debug <n>
sets debugging level - controls what level of information is sent to the
control window and debug file (if any).
0 no debug output
1 script progress
2 text received from modem
3 log both text & script
echo [/status] [/date] <string>
echoes a string (or set of strings) to the control window (default)
or the status window.
/date adds the current date to the string before writing.
set <variable> <value> [<variable> <value> ... ]
assigns a value to a script variable. <value> should be quoted if it
includes spaces. More than one variable/value pair may be set at once.
unset <variable>
deassigns a script variable.
?eq <variable> <variable|value>
?ne <variable> <variable|valu