background image
<< Porting Tests to Other GUIs | Porting Tests - type statements >>
Porting Tests - Marking 4Test code as GUI-specific
<< Porting Tests to Other GUIs | Porting Tests - type statements >>
266
User's Guide
13 P
ORTING
T
ESTS
TO
O
THER
GUI
S
Marking 4Test code as GUI-specific
List of available GUI
specifiers
For a complete list of GUI specifiers, see "GUITYPE data type" in online
Help.
Syntax of a GUI
specifier
A GUI specifier has this syntax:
[[gui-type [, gui-type]] | [! gui-type]]
gui-type is the GUI. You can express this in one of two mutually exclusive
ways. For example, you can specify one or more GUIs separated by commas,
as in:
motif, msw
Or you can specify all but one GUI, as in the following, which indicates that
what follows applies to all environments except Macintosh:
! mac
Where you use GUI specifiers
A GUI specifier can appear before any 4Test declaration or statement except
the use statement, which must be evaluated at compile time, with the
following exceptions.
switch statements
You can use GUI specifiers before an entire switch statement and before
individual statements within a case clause, but you cannot use GUI specifiers
before entire case clauses.
// legal:
msw, motif switch (i)
case 1
msw Print ("hello")
motif Print ("goodbye")
case 2
msw raise 1, "error"
motif Print ("continue")
default
msw Print ("ok")
// NOT legal:
switch (i)
msw case 1
Print ("hello")
motif case 1
Print ("goodbye")
if statements
You can use GUI specifiers in if statements, as long as GUI specifiers used
within the statement are subsets of any GUI specifiers that enclose the entire
if statement: