Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 382 of 909
DEFAULT
Default Case for SWITCH Structure
APPLICATION: Program execution and flow control
DESCRIPTION: Default for SWITCH program control block
EXECUTION: Immediate
CONDITIONAL TO: N/A
LIMITATIONS: Must reside within a SWITCH and ENDS structure
READ/REPORT: N/A
WRITE: N/A
LANGUAGE ACCESS: N/A
UNITS: N/A
RANGE OF VALUES: N/A
TYPICAL VALUES: N/A
DEFAULT VALUE: N/A
FIRMWARE VERSION: 5.x and later
COMBITRONIC: N/A
DETAILED DESCRIPTION:
DEFAULT allows controlled code execution in a SWITCH structure for results that are not
evaluated by CASE. There can only be one DEFAULT statement per SWITCH control block.
DEFAULT is not a valid terminal command. It is only valid within a user program.
In the following example, DEFAULT is used when no CASE can be executed for the value of
"v".
EXAMPLE:
SWITCH x
CASE 1
PRINT(" x = 1 ",#13)
BREAK
CASE 2
PRINT(" x = 2 ",#13)
BREAK
CASE 3
PRINT(" x = -23 ",#13)
BREAK
DEFAULT
PRINT("x IS NOT 1, 2 OR -23",#13)
BREAK
ENDS
Part 2: Commands: DEFAULT