03-24-2017, 05:30 PM
If you're taking suggestions for additions to HPPL, I'd like to propose the addition of ELSEIF (or ELIF). With lengthy IF-THEN structures, it can tighten up the code considerably.
Tom L
Current way (greatly trivialized example):
Now improved with ELSEIF
Tom L
Current way (greatly trivialized example):
Code:
IF x>7 THEN
PRINT("TOO HIGH");
ELSE
IF X<4 THEN
PRINT("TOO LOW");
ELSE
PRINT("JUST RIGHT");
END;
END;
Now improved with ELSEIF
Code:
IF x>7 THEN
PRINT("TOO HIGH");
ELSEIF X<4 THEN
PRINT("TOO LOW");
ELSE
PRINT("JUST RIGHT");
END;