[fpc-pascal] basic question on begin, end;
Christo Crause
christo.crause at gmail.com
Wed Sep 23 16:45:23 CEST 2020
On Wed, Sep 23, 2020 at 4:25 PM dano none via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:
> end;
> my_base := my_base + 15;
> writeln('current base ',my_base:2);
> ch := ReadKey;
> { end; { end i = column indexer }}
>
A different way to explain Bart's comment is that the inner loop over j is
a compound statement (between the inner loop begin/end block) which is
followed by more statements (the statements after the first end quoted
above). If you comment out the outer begin/end block these statements are
not included in the execution of the outer loop, so for example my_base is
not incremented as part of the outer loop if the begin/end pair is
commented out as indicated in your example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200923/b562a637/attachment-0001.htm>
More information about the fpc-pascal
mailing list