## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### Tool Directives

The P2STRING tool supports either multithreaded or multiprocess execution, but not both. You can use tool directives to test either @PROCESSES or @ THREADS in a script file.

Tool directives start with an at sign (@) in the first column. These directives affect the execution and appearance of the output. The following classes of directives are recognized:

Initialization
Execution

Initialization Directives

Use initialization directives to set up the content of the script file. These directives must appear before execution directives because the tool preprocesses the script file and builds process command buffers.

The @THREADS and @PROCESSES directives are mutually exclusive. In other words, the P2STRING tool supports either multithreaded or multiprocess execution in a script file (not both). In addition, there is a limit of 10 processes or threads per script file.

The following table lists the supported initialization directives.

Directive Description

    @PROCESSES=x

Specifies the number (x) of processes the script file will be running. For example:

    @PROCESSES=2

    @THREADS=x

Specifies the number (x) of threads the script file will be running.

    @EVENTS={n[=0|1] [,n[=0|1]]}

Specifies one or more names of events. Events are user-defined with a maximum of 15 characters. Events can be set to 1 or 0. Set an event to 1 for an event that is set with the @SET_EVENT execution directive. Set an event to 0 to clear or reset the event. If no initialization values are specified, the event is initialized to 0. For example:

    @EVENTS={brad=1,john=1,test=0}

Execution Directives

Use execution directives to process the script file. Again, the @THREAD and @PROCESS directives are mutually exclusive.

The following table lists the supported execution directives.

Note: Timing out on the @WAIT_EVENT and @WAIT_NOTIFY directives is not considered a failure.

Directive Description

    @THREAD x

Specifies that the script lines following this directive belong to thread number x until the next @THREAD directive is encountered.

    @PROCESS x

Specifies that the script lines following this directive belong to process number x until the next @PROCESS directive is encountered.

    @SET_EVENT name 0|1

Sets the event name to either 1 or 0. Use 1 to mark that the event has happened. Use 0 to clear or reset the event.

Note: The event must be declared through the @EVENTS directive.

    @WAIT_EVENT name [to]

Waits until the event name is set to 1. @WAIT_EVENT does not cause a change of the event state. If you need a reusable event, use this directive.

The timeout (to) is specified in milliseconds. If omitted, it defaults to 3 minutes.

    @WAIT_NOTIFY x [to]

Waits for a specific number (x) from an expected MM_ MCINOTIFY notification message. This number must match the index used in the MM_MCINOTIFY reference line. The @WAIT_NOTIFY events are not reusable because there are no events that logically reset it.

The timeout (to) is specified in milliseconds. If omitted, it defaults to 3 minutes.

If the associated mciSendString function fails, the event is posted to prevent delays for notifications that are never going to be sent.

    @WAIT_PASSDEVICE alias [to]

Waits until the device instance with an alias of alias gains use. This assumes that the alias names used within a script file are unique. The maximum alias name length is 20 characters.

Note: Use a unique alias for every OPEN command.

The timeout (to) is specified in milliseconds. If omitted, it defaults to 3 minutes.

The tool assumes that a unique alias is specified on each OPEN string command. If unique aliases are not used, errors conditions might occur.

    @REM comment

Echoes the comment to the screen and the output log file. All other script comment lines (those starting with ; or #) are neither transferred nor displayed.

    @PAUSE to

Pauses processing of the current thread or process in the input script file for the specified time. It does not stop the processing of the notifications or window functions. Other threads or processes are not affected by this directive.

    @BREAK   [ message ]

Causes a message box to appear with message text. Script processing is halted until the user responds with the correct action . For example:

    @BREAK [replace the CD]

    @CHECK [message]

Grades the success of the previous command based on the user's response. A pop-up window displays the message and prompts the user with Yes or No push buttons. The status is passed if the user selects Yes, or failed if No is selected. For example:

    @BREAK The music will play for 5 seconds.  Ready to time it?

    play cdaudio notify

    @PAUSE 5000

    @CHECK Did it play?