Command Conditions

Another bit of background before we tackle the reference section concerns conditional execution. In many languages you have some type of "if" statement. If some condition is true or exists, you perform one command. If that condition is false or does not exist, you perform a separate command—or often no command at all. DVDSP goes the one-command-or-none-at-all route. Figure A-4 highlights the condition section of the Script Command Inspector.

The conditional area for script commands

Figure A-4. The conditional area for script commands

The basic setup of a comparison is to look at one of the GPRM or SPRM values and compare it to something else (another variable or maybe an Immediate value).

With the exception of the No Operation (Nop) command, you can apply a condition to any script command. You just check that condition checkbox and enter your condition.

You can compare items using the same types as those listed in the previous section (namely GPRM, SPRM, Immediate, Jump Target, and Special). If the condition you set up is true, your command will execute. Otherwise your command is skipped and execution picks up on the next line of the script.

Comparison types

You can use seven comparisons in the Compare Command area. Table A-2 lists those tests with a brief description of their purpose.

Table A-2. Compare Command tests

Option

Test

Description

=

Equals

Returns true if the variable and the value are ...

Get DVD Studio Pro 3: In the Studio now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.