MQL Scripts

Scripts are useful when you are performing many changes to the 3DSpace database, either in the initial building process or when updating an existing database. MQL scripts provide a written record that you can review. Using a text editor to create the script makes it easy to duplicate similar blocks of definitions or modifications.

When building a script, there are several MQL commands that help run other scripts and let you monitor the processing of MQL commands.

Command Description
output VALUE;
Prints a message to your output device. This is useful within scripts to provide update messages and values while the script is processed. For example, if you are processing large blocks of commands, you might want to precede or end each block with an Output command. This enables you to monitor the progress of the script.
password PASSWORD; Lets you change the current context password. The Password command enables you to change your own password (which can also be done with the Context command).
run FILE_NAME [continue]; Lets you run a script file. This is useful if you are working in interactive mode and want to run a script. The continue keyword allows the script to run without stopping when an error occurs. This is essentially the same as running MQL with the -k option, but it is available at run time, making it usable by programs.
shell COMMAND; Lets you execute a command in the operating system. For example, you can perform an action such as automatically sending an announcement to a manager after a set of changes are made.
verbose [on|off]; Lets you increase or decrease the amount of message detail generated by the MQL interpreter as the script is processed. When set to ON , more detail is provided. When set to OFF, only errors and important system messages are displayed.
version; Outputs the version of MQL. Tthis is useful if you want a record of the version used to process a script.

You should include comments in your scripts to visually divide scripts into manageable sections and remind you of why structures and objects were defined and modified. Comments are preceded by a pound sign (#), are ignored by MQL:

# script comments