TrueGui Help
TrueGUI Script Files

Glossary Item Box

 

TrueGUI script files are ordinary text files that contain TrueGUI commands to be executed in sequence. They are useful for learning the TrueGUI command syntax when a server program is not active. Script files can also be used to simplify application programs by putting commonly used command sequences into a script file and then executing the file with a TrueGui.RunScript("Filename") command. 

Script files have an extension of "tgs" standing for "TrueGui Script". Script files reside on the client-side PC in the default subdirectory "Scripts" unless changed by using the TrueGui.ScriptsDirectory property. 

Script files are written using .NET native syntax, which means that string literals are enclosed in double quotes instead of the TrueGUI StringDelimiter characters. 

 

The following example shows a script file that loads an assembly and then loads and shows a form: 

! Load the CsForms assembly which contains Form1 and Form2

TrueGui.LoadAssembly("CsForms")

 

! Create and show the Form2 instance

Form2 = New Form2()

Form2.Text="My first Form2 Called "Form2""

Form2.Show()

 

Notice that comments may be used. Anything, outside of a quoted field, beginning with an exclamation mark is treated as a comment and not passed to the TrueGUI processor.