Like any real programming language, SALT has a large number of features. Because of this, programming in SALT is not easy for the beginner who has no knowledge of any programming concepts. However SALT scripts can be used to different degrees. The advanced user can program complex applications, while even a novice can modify the sample scripts include with Telix, and run scripts supplied by others.
For advanced users, a separate 100+ page manual describes SALT and its syntax. The rest of this section describes how to create, run and compile the various forms of scripts. All forms of scripts must be compiled by one of the two compilers (CS.EXE or CSS.EXE) and all scripts are executed with the ALT-G command.
If you have an already compiled SALT script (ending with the extension 'SLC' (for example, the QDHOST.SLC Host Mode script file), it is very easy to execute. While in terminal mode, press Alt-G. Telix will ask for the name of the script file to run. If you supply no extension, 'SLC' is assumed. If a special directory where script files are to be found has been defined, Telix will look there for script files, unless path is given. To define this script directory use the Telix Configuration Menu. Telix will then load the script file and follow its instructions. To abort a script while it is executing, press the Esc key. Sometimes you may have to press Esc twice, the first time to abort the current function, and the second time to abort the script itself.
You may have used your text editor to modify one of the sample scripts included with Telix (most simply require inserting your name in a clearly marked location near the top). You now need to compile the script file. To do this, the CS.EXE program is used. While at the DOS prompt, type 'CS', followed by a space and the name of the script file you want to compile (the extension 'SLT' is assumed if none is given). CS will scan through the source file and produce the compiled version, using the same base name but the extension 'SLC'. If a syntax error is discovered while compiling the script file, CS will report it and abort. In that case the error should be fixed and CS run again. From within Telix, you may quickly run CS either by using the DOS Command function (Alt-V), or from the DOS Shell (Alt-J). Remember, every time you make a change to the source file, you must re-compile it, otherwise Telix will still run the old compiled ver- sion. This sounds tedious, but in practice once a script is developed it doesn't change very often.
Simple requires that the CS.EXE SALT compiler reside in the DOS path. A complete listing of all SIMPLE scripting commands and structures is available in SIMPLE.DOC or in the printed manual.
To learn a sequence of responses to prompts, toggle the learn mode on from telix Terminal mode by pressing ALT-9. Enter the name of the script to learn when prompted. .SLT is assumed to be the filename extension if one is not given.
Telix will record your responses to the various prompts of the online service until learning mode is turned off with ALT-9 again. When turned off, Telix saves the learned script. Remember, the learned script must be compiled prior to use.
It is important while learning a script to remember to wait for the complete prompt to be displayed before responding. Unpredictable results can be exhibited if a fast typist or a user familiar with a service types ahead of the prompts.
Learned scripts, while useful, are not always completely accurate, and may not work without editing. If the prompt being responded to contains information that can vary (such as the number of minutes left online), then the .SLT file may need to be edited prior to being compiled. An example is the prompt on the Telix support BBS, which usually reads much like the following:
(4 used, 86 left) Main Board Command?
If there are not exactly 86 minutes remaining on your next call, a learned script containing this prompt will not function properly. The line in the learned script:
waitfor("(4 used, 86 left) Main Board Command", 30);
should thus be edited to read:
waitfor("Main Board Command", 30)
for proper operation of the learned script.
Script learning is only available in registered versions of Telix.