Previous Topic: %Substr()

Next Topic: %TableOwnerIgnoreOption

%Switch()

Evaluates the switch argument and matches the result against the specified choices. The macro code corresponding to the matching choice is expanded. If no match is found, the default macro code is expanded.

Syntax

%Switch(<argument>) {

%Choose(<choice 1>) {<macro code 1>}

%Choose(<choice 2>) {<macro code 2>}

<etc...>

%Default {<default macro code>}

}

Syntax Example

/* If %TableName is MOVIE_COPY */

%Switch(%TableName) {

%Choose(MOVIE_COPY) { %FK}

%Choose(MOVIE_RENTAL_RECOR) { %PK}

%Default{%PK}

}

Expansion

master_number

Usage

Classified as a Miscellaneous macro.