Syntax
SetPhantom
[Normal | Minimized | Hidden]
[TraceInit]
[TraceOn | TraceOff]
[LoggingOn | LoggingOff]
[ErrorPopupsOn | ErrorPopupsOff]
[SuspendErrorPopups | RestoreErrorPopups]
[TerminateOnError | ContinueOnError]
[FastPlay | NormalPlay]
[Uninterruptable | Interruptable]Description
Set Phantom display style, tracing, and playback speed.Parameters
Normal | Minimized | Hidden
- Optional. Set Phantom control panel display style.
TraceInit
- Optional. Deletes the trace file if it exists. Creates a new trace file and places header information in it including the Phantom version, Windows version, and the date and time. This does not affect the current trace state (On or Off).
TraceOn | TraceOff
- Optional. Turn tracing to the trace file on or off. The trace file can be changed from the Phantom Options Dialog or by setting the TraceFile intrinsic variable from within a script.
LoggingOn | LoggingOff
- Optional. Turn logging to the Phantom log panel on or off.
ErrorPopupsOn | ErrorPopupsOff
- Optional. Enables or disables the display of pop-up error windows for errors encountered during script execution. (See the remarks section for details.)
SuspendErrorPopups | RestoreErrorPopups
- Optional. Disables error popups or restores the previous error popup state. (See the remarks section for details.)
TerminateOnError | ContinueOnError
- Optional. Determines Phantom's behavior in the event of errors encountered during script execution. (See the remarks section for details.)
FastPlay | NormalPlay
- Optional. Set the playback speed. (See the remarks section for details.)
Uninterruptable | Interruptable
- Optional. When in uninterruptable mode, Phantom playback is not terminated by Ctrl-Esc or Ctrl-Alt-Del as it would be otherwise. The default is Interruptable.
Remarks
The special intrinsic variables FastPlayMouseMovementDuration, FastPlayMouseClickDelay, FastPlayKeystringDuration, FastPlayKeystringDelay, and FastPlaySingleKeystrokeDelay are initalized from the current configuration during playback initialization and are copied to the active fast playback settings whenever SetPhantom FastPlay is executed. Thus, to alter the fast playback settings from within a Phantom script, you must follow assignment to any of these variables with a SetPhantom FastPlay statement. Settings changed in this way are effective until the script terminates or until another assignment followed by excecution of a SetPhantom FastPlay statement is performed. Typically, changes to fast playback settings are made in the script's Init subbroutine.The ErrorPopupsOn and ErrorPopupsOff control whether a pop-up error dialog window is automatically produced when an error is encountered during execution of a Phantom script. Regardless of the error popups setting, error messages are written to the Phantom log (and to the trace file if it is enabled). Turning error popups on pauses the script at the statement that produced the error and displays a dialog that allows you to ignore the error and continue or terminate script execution at that point. For this reason, turning error popups on is recommended during script development and the Phantom recorder places a "SetPhantom ErrorPopupsOn" statement at the beginning of all scripts.
There may be errors that occur in your script that are handled in the normal course of execution and you would like to disable popups only for that section of code. This is accomplished by placing a "SetPhantom SuspendErrorPopups" statement before the statements that produces the error and a "SetPhantom RestorePopups" after the statement that produces the error.
To cause a script to continue execution after an error occurs, use the "SetPhantom ContinueOnError" statement. To cause a script to immediately terminate when an error occurs, use the "SetPhantom TerminateOnError" statement. Note that if error popups are turned on, the action specified through the error popup dialog superscedes the Terminate/ContinueOnError setting.
Example
Start::
TraceFile = "C:\PhantomTrace.txt"
SetPhantom TraceInit TraceOn
...
...The above script fragment sets the trace file name, initializes it and sets tracing on.