cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Case statement

kwsauter
1-Visitor

Case statement

I know I can do nested if statements, but that gets really cumbersome
with anything that's halfway complicated. I've never seen it, but does
anybody know if some kind of case statement can be done in relations?

Instead of

If case1
A
Else
if case2
B
else
if case3
C
else
D
endif
Endif
Endif

How about

Case case1
do A
Case case2
do B
Case case3
do C
Otherwise
do D
Endcase

It's a lot simpler to deal with and makes it much easier to handle
complicated situations. Nesting more than two or three if statements
gets to be a nightmare.

Anybody?

Ken Sauter
DRS Reconnaissance Surveillance and Target Acquisition
Infrared Technologies Division
PO Box 740188
Dallas, TX 75374
469-221-5430
-

NOTICE: This e-mail transmission (and/or the attachments accompanying
it) may contain confidential or proprietary information belonging to DRS
Technologies or the sender. The information is only for the use of the
intended recipient. If you are not the intended recipient you are hereby
notified that any disclosure, copying, distribution or the taking of any
action in reliance on the contents of this information is strictly
prohibited. Any unauthorized interception of this transmission is
illegal under the law. If you have received this transmission in error,
please promptly notify the sender by reply e-mail, and then destroy all
copies of the transmission.

"This (document/presentation) may contain technical data as defined in
the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10.
Export of this material is restricted by the Arms Export Control Act (22
U.S.C. 2751 et seq.) and may not be exported to foreign persons without
prior written approval from the U.S. Department of State."



This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 REPLY 1
RandyJones
19-Tanzanite
(To:kwsauter)

On 01/05/10 09:26, Sauter, Kenneth W (SA-1) wrote:
> I know I can do nested if statements, but that gets really cumbersome
> with anything that's halfway complicated. I've never seen it, but does
> anybody know if some kind of case statement can be done in relations?

I have encountered this same issue several times. As far as I know there
is no "case" statement and also no "else if" for the existing "if".

>
> Instead of
>
> If case1
> A
> Else
> if case2
> B
> else
> if case3
> C
> else
> D
> endif
> Endif
> Endif

Or if the "if" statement had an "else if" you could do
if case1
A
else if case2
B
else if case 3
C
endif

>
> How about
>
> Case case1
> do A
> Case case2
> do B
> Case case3
> do C
> Otherwise
> do D
> Endcase

A "case" statement would be nice.

>
> It's a lot simpler to deal with and makes it much easier to handle
> complicated situations. Nesting more than two or three if statements
> gets to be a nightmare.

I totally agree.

>
> Anybody?
>
> Ken Sauter
> DRS Reconnaissance Surveillance and Target Acquisition
> Infrared Technologies Division
> PO Box 740188
> Dallas, TX 75374
> 469-221-5430
> -_ <">mailto:->


--
Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags