×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
But look, RPG just simplified the PL/I version from
IF (A < B) THEN DO;
Z = A;
END;
ELSE DO;
Z = B;
END;
to
IF (A < B);
Z = A;
ELSE;
Z = B;
ENDIF;
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Mark S Waterbury <mark.s.waterbury@xxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: Mark S Waterbury <mark.s.waterbury@xxxxxxxxxxxxx>
Date: 07/20/2016 12:14AM
Subject: Re: RPG
Vern:
In Algol, Pascal and Ada, a semicolon is used as a statement separator,
not a statement terminator. So you might have:
if a < b then begin
z := a;
end
else begin
z := b;
end;
(The final semicolon is only needed when this if-else statement is
followed by another statement in a compound statement block.)
In PL/I, designed by IBM in the mid-1960s, the semicolon is a statement
terminator, as currently used in free-form RPG IV. For example:
IF (A < B) THEN DO;
Z = A;
END;
ELSE DO;
Z = B;
END;
C was influenced by PL/I in many ways -- C statements end with a
semicolon, except when braces are used, in which case, a ";" never
follows the final "}" closing brace. For example:
if (a > b)
z = a;
else
z = b;
-or-
if (a > b) {
z = a;
}
else {
z = b;
}
HTH,
Mark S. Waterbury
On 7/19/2016 4:56 PM, Vernon Hamberg wrote:
Crazy quirks? (See John's statement below) Semicolons?
Let's see, languages like C, Pascal, Algol, Ada, PL/I, et al, used
semicolons to indicate the end of a line - and Javascript today can
use them although optional, last I looked.
Not so crazy anytime, methinks!
Vern
As an Amazon Associate we earn from qualifying purchases.