/sys$common/syshlp/helplib.hlb PASCAL, Statements, IF_THEN_ELSE, Examples *Conan The Librarian (sorry for the slow response - running on an old VAX) |
IF x > 10 THEN y := 4 IF x > 10 THEN BEGIN y := 4; ELSE y := 5; z := 5; END ELSE y := 5; The ELSE clause always modifies the closest IF-THEN statement. Use caution to avoid logic errors in nested IF statements, as in the following: IF A = 1 THEN {First IF} IF B<>1 THEN {Second IF} C := 1 ELSE {Appears to modify first IF} C := 0; {Actually modifies second IF}
|