Tutorial #1
Overview of Program Syntax
The semicolon is used as a line terminator in several programming languages. PL/i is no exception. The rhyme and reason for deciding where to put them is as logical, or illogical, as with other languages, too. We attempt to de-mystify usage of the semicolon in this tutorial.
A PL/i program in its simplest form looks like this:
|
program name
declare
begin
<statement> ;
end |
Note that the semicolon marks the end of the statement. (No extra space is needed between the statement and the semicolon - it is only used here for emphasis.)
We do need to put a real statement in place of <statement>. So let's try something really simple, and turn on relay #1 on AddMe III. Now our program looks like this:
|
program name
declare
begin
seti (25, 1);
end |
This will compile and run, and turn on the relay, exactly as shown here.