The one thing you need to avoid with SWITCH (and WHILE) statements:
Don't use a GOTO to exit the structure.

Dennis McGrath


> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Bruce A.
> Chitiea
> Sent: Saturday, January 31, 2015 1:29 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: Performance: IF/ELSE/ENDIF v SWITCH/ENDSW
> 
> Razzak:
> 
> Thank you for the clear 'splainin'.
> 
> Just another of R:BASE turning the most tortured logic into 'child''s play',
> in two flavors.
> 
> Superb work, Dr. Memon.
> 
> Thanks, and Cheers!
> 
> Bruce
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of A.
> Razzak
> Memon
> Sent: Saturday, January 31, 2015 10:59 AM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: Performance: IF/ELSE/ENDIF v SWITCH/ENDSW
> 
> At 01:02 PM 1/31/2015, Bruce A. Chitiea wrote:
> 
> >I've successfully coded the same critical piece of a tiny, single user
> >development database both ways.
> >
> >In your experience, are there any performance advantages for one over
> >the other, were this a live, monster, multi-user database?
> 
> 
> Bruce,
> 
> Technically, the SWITCH statement is a control statement that handles
> multiple selections by passing control to one of the CASE statements within
> its body.
> 
> The SWITCH statement allows the developer to control the order in which
> the
> codes are executed because it is a "conditional" statement.
> 
> Nested "IF statement" can be rewritten as one SWITCH statement.
> 
> The SWITCH and CASE keywords evaluate expression and execute any
> statement
> associated with constant-expression whose value matches the initial
> expression.
> 
> Last but not least, to optimize the code, ALWAYS type the BREAK keyword at
> the end of each condition otherwise the compiler will execute every 'CASE'
> statement even if only one condition is met.
> 
> Have fun!
> 
> Very Best R:egards,
> 
> Razzak.
> 
> www.rbase.com
> www.facebook.com/rbase
> --
> 32 years of continuous innovation!
> 17 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
> --
> 

--- RBASE-L
=======================3D=======================3
D=
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)
=======================3D=======================3
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================3
D=
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================3
D=
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.
=======================3D=======================3
D=


Reply via email to