The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Requesting ELSEIF
03-24-2017, 05:30 PM
Post: #1
Requesting ELSEIF
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):

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;

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Requesting ELSEIF - toml_12953 - 03-24-2017 05:30 PM
RE: Requesting ELSEIF - Han - 03-24-2017, 05:38 PM
RE: Requesting ELSEIF - toml_12953 - 03-25-2017, 11:43 AM
RE: Requesting ELSEIF - compsystems - 03-24-2017, 06:21 PM
RE: Requesting ELSEIF - toml_12953 - 03-24-2017, 06:52 PM
RE: Requesting ELSEIF - Carlos295pz - 03-24-2017, 07:45 PM
RE: Requesting ELSEIF - compsystems - 03-24-2017, 08:16 PM
RE: Requesting ELSEIF - compsystems - 03-24-2017, 07:16 PM
RE: Requesting ELSEIF - toml_12953 - 03-24-2017, 07:33 PM



User(s) browsing this thread: 1 Guest(s)