MPC2000 Reference Manual [JAPANESE] [ENGLISH]
yControlStatementz   yControlz
yUSEz
SELECT_CASE

SELECT_CASE IN(0)&&HF
CASE 1 : GOSUB *A
CASE 2 : GOSUB *B
CASE_ELSE GOSUB *C
END_SELECT

SELECT_CASE VOID
CASE SW(1) : GOSUB *A
CASE SW(2) : GOSUB *B
CASE_ELSE GOSUB *C
END_SELECT
yFORMATz yFUNCTIONz
SELECT_CASE arg

Causing branches depending on the arg value of CASE statement.
Causing branches depending on the logical eqation of CASE statement.
yEXPLANATIONz
When the arg of SELECT_CASE is some value, It causes branches depending on the arg value of CASE statement ByEXAM 1z
When the arg of SELECT_CASE is the constatnt VOID,
Causing branches depending on the logical eqation of CASE statement.yEXAM 2z

Remarks;
When a contion is matched, imidiately it causes the branch and ignor the later lines.
Allows the AND OR conjunction in the CASE statement.
The 2 CASE statements in a row, The both of 2 conditions cause the same process.ByEXAM 3z




yEXAM 1z
SELECT_CASE a
CASE 1 : PRINT 1
PRINT 111
CASE 2 : PRINT 3
PRINT 123
CASE_ELSE : PRINT 4
PRINT 456
END_SELECT

yEXAM 2z
SELECT_CASE VOID
CASE SW(192)==1 : PRINT 192 : WAIT SW(192)==0
CASE SW(193)==1 : PRINT 193 : WAIT SW(193)==0
CASE SW(194)==1 : PRINT 194 : WAIT SW(194)==0
CASE_ELSE
END_SELECT

yEXAM 3z
SELECT_CASE A
CASE 0
CASE 1 : PRINT 1
CASE 2 : PRINT 2
CASE 5 : PRINT 5
CASE_ELSE : PRINT 3
END_SELECT

SELECT_CASE VOID
CASE A==0
CASE A==1 : PRINT 1
CASE A==2 : PRINT 2
CASE A==5 : PRINT 5
CASE_ELSE : PRINT 3
END_SELECT
[LASTMODIFY]2009-07-24 13:51:36 [CREATEDATE]2007-07-20 20:06:44
MPC2000 Reference Manual -R5.11-   (C)2007 ACCEL Corp. all right reserved.