Lortug Documentation | ||
---|---|---|
Prev | Chapter 4. Creating Scripts |
Lortug has some commands that are built into it. These commands generally are used to effect the state of lortug (ie set the current working directory, etc.) or manipulate variables and toolbar components. The following list details the available commands:
SetVar([var name], [value])
Sets the variable named [var name] to [value].
ClearBox([widget name])
Clears a text box or the text box part of the combo box with name [widget name].
ClearList([widget name])
Clears the drop down list of the combo box named [widget name].
AddToList([widget name], [strings])
Adds the strings given in [strings] to the list of the combo box named [widget name]. The elements in [strings] are delimited by whitespace.
SetBox([widget name], [string], [activate])
Sets the contents of the text box or text box part of the combo box named [widget name] to [string]. If [activate] is anything other than the empty string the box will be activated as though the user had hit enter while typing in the box.
SetToggle([widget name], [state])
Sets the state of the toggle button named [widget name] to [state] ([state] follows the usual conventions for true/false so that expansion can be used in this argument).
Shell([shell command])
Executes the given shell command in a shell. Waits for the command to finish before returning. If used in an expansion it will return the output of the shell command. [shell command] can contain multiple shell commands delimtied by ;'s, all the commands will be executed in the same shell.
GetFilename([title], [var], [box], [activate])
Uses a dialog box to get a filename. The dialog is given the title [title]. The filename is stored in variable [var] and [box] is the name of a text or combo box that will have its contents set to the filename. [activate] controls whether the text/combo box is activated when the filename is placed in it.
SetWindowTitle([title])
Sets the title of the lortug window to [title].
ChangeDir([dir name])
Changes the current working directory. If [dir name] is provided then the directory will be set to that. Otherwise a dialog box is openned that the user can use to select a directory.
PrintDir()
Returns the current working directory.