At 03:14 PM 7/21/2013, Bruce A. Chitiea wrote:

I can't recall ever seeing a posting on the SWITCH syntax, I suppose
because it is very straightforward.

Is it the best tool to use when the number of outcomes to the driving
<expression> is fixed, or would I do better focusing on more dynamic
constructs such as loops driven by SSUB-parsed value lists?

Bruce,

Here you go ...

The SWITCH statement is a control statement that handles multiple
selections by passing control to one of the CASE statements within
its body.

Syntax:

SWITCH ([expression])
   CASE [value]
      [case-block]
      BREAK
   DEFAULT
      [default-block]
      BREAK
ENDSW

The SWITCH statement can include any number of CASE instances,
but no two case statements can have the same value.

The SWITCH and CASE statements help control complex conditional
and branching operations. The switch statement transfers control
to a statement within its body.

Use the DEFAULT clause to provide a statement to be executed if
none of the label values matches expression. It can appear
anywhere within the SWITCH -ENDSW code block.

In addition to handling multiple selections by passing control
to one of the CASE statements within its body, the SWITCH
provides an efficient mechanism for controlling, tracing, and
debugging output at run time using external settings.

Practically, you may define a common code template/Form Action
and then use the R:BASE "% Variables" to pass all required
parameters for SWITCH and CASE values.

And, that is your tip of the day!

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase
--
30+ years of continuous innovation!
15 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================


Reply via email to