Home »
Public Forums »
archive »
CASE statments
CASE statments [message #4478] |
Tue, 20 June 1995 00:00 |
wart
Messages: 8 Registered: March 1995
|
Junior Member |
|
|
I've got a simple question about using case statements in IDL:
Is there any way to associate more than one tag with a set of
instructions: Something like
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;
CASE event.id OF
red_text: BEGIN
; do lots of stuff here
END
grn_text: BEGIN
; do lots of stuff here
END
blu_text: BEGIN
; do lots of stuff here
END
ENDCASE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
change the above to become something like:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
CASE event.id OF
red_text: grn_text: blu_text: BEGIN
; do lots of stuff here
END
ENDCASE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
The 'do lots of stuff' is the same for each case. C lets you do this
just as I've shown in the second case. Will IDL let you do this as
well?
--Wart
|
|
|
Current Time: Fri Oct 10 14:59:53 PDT 2025
Total time taken to generate the page: 1.91995 seconds