GibPascal Blog
Brought to you by:
elfstones69
'while .. do' loops have been added to the GibPascal 1.3 release.
Usage format is as following:
[while [variable]|[count]|[<|>] [value] do begin ... end]
Here is an example of the 'while .. do' using a variable:
loop1 := 5;
while loop1 < 10 do
begin
loop1 := loop1 + 1;
loop2 := loop2 + 2;
writeln('loop1 = ',loop1,' loop2 = ',loop2);
end;
This example would run the three internal loop statements 5 times.
Here is an example of the 'while .. do' with the 'count' reserved word:
while count 12 do
begin
loop1 := loop1 + 1;
loop2 := loop2 + 2;
writeln('loop1 = ',loop1,' loop2 = ',loop2);
end;
This would run the three internal loop statements 12 times.