New scripting feature allows programmers to automate TPF/GI
In order to give TPF programmers an even more efficient way to test, TPF Software has introduced a new scripting feature into TPF/GI.
Scripts allow programmers to automate TPF/GI in dramatic ways. Here are some of the things programmers can do with scripts.
Set up testing. Programmers can use scripts to automatically set macro and instruction trace, add files to Source View trace, and run a program.
Run multiple message files. Message files are an earlier kind of scripting: they contain a series of input commands for terminals. Using the new scripting feature, programmers can run several message files in a row and automatically stop and start terminal logging and recording.
What is a script?
A script is a text file written in one of several scripting languages, most likely VBScript (Visual Basic script).
Scripts allow programmers to automate TPF/GI in dramatic ways.
The script contains one required function or subroutine, named main, although the programmer can code other functions as well. Scripts can also contain comments (see Example 1 on the next page).
The TPF/GI object model
Scripts do most of their work by calling on objects that TPF/GI makes available.
Don’t let the word "object" sound threatening, however. Scripts are made up of straightforward, procedural programming, as Example 1 on the next page demonstrates.
The available objects for scripting are listed in the side-bar on the next page. They include terminal objects such as ALC1, ALC2, LOC1, LOC2, PrimeCRAS, and GIConsole. There is also a Source View object (SView), a Run object, a CMS object, an App object, and a Windows object. More objects will be added in the future.
Using scripts
Scripts are controlled from the new Scripts Window (Figure 1), reached by selecting File>Scripts from the menubar.

Figure 1: The Scripts window.
To write a new script, programmers can click the New button on the Scripts Window. Once the programmer has selected a script name and script language, the Notepad applet will appear containing a main subroutine. Here the programmer can type in his code and save the script.
To run a script, the programmer simply double clicks the script name in the Scripts Window.
Scripts are powerful. Depending on the contents of the script, windows will appear and disappear, commands will be sent to the host, breakpoints will be set, and files will be loaded into Source View. As the script executes, the top of the Script Window provides a play by play description of each call to TPF/GI.
|