代码大全

(singke) #1

goto if-then else Basic
1000 ' if ( A<B ) then
1010 IF NOT A<B THEN GOT0 1 100
1020 CODE TO PERFORM IF THE ORIGINAL CONDITION IN COMMENTS IS TRUE
...
1090 GOTO 1200
1 100 ' else
1110 CODE TO PERFORM IF THE ORIGINAL CONDITIONIN COMMENTS IS FALSE
...
1200 ' endif
goto


17.6.2 case


goto case if then else
if then
Fortran case
C case LETTER
C 'A':
IF LETTER .NE. 'A' GOTO 1100
DO SOMETHING FOR CASE A
GOTO 1900
C 'E':
1 110 IF LETTER .NE. 'E' GOTO 1200
DO SOMETHING FOR CASE 'E'
GOTO 1900
C 'F' ''
1200 IF LETTER .NE. 'P' GOTO 1300
DO SOMETHING FOR CASE 'F'
GOTO 1900
C else
1300 CONTINUE
CALL ERROR ''Internal error:Call customer assistance.''
1900 CONTINUE
C end case
if goto if
else CONTINUE goto
goto case 1900
Basic


17.6.3 while


while while
Free download pdf