IDL case 语法【syntax】
(2012-09-22 14:18:14)
标签:
idlit |
分类: IDL |
IDL的帮助中是这样的:
Syntax
CASE expression OF
[ ELSE: statement ]
ENDCASE
Examples
This example illustrates how the CASE statement, unlike SWITCH, executes only the one statement that matches the case expression:
IDL Prints:
two
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
但是对于每个case中不止一句的话,
需要加上begin 和 end
Examples
x=2
CASE x OF
1: begin
PRINT, 'one'
y=x
print, y
end
2: PRINT, 'two'
3: PRINT, 'three'
4: PRINT, 'four'
ENDCASE

加载中…