diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-03-13 21:33:54 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-03-13 21:33:54 -0400 |
commit | cb381413a77594a702d3679624500377b9f98854 (patch) | |
tree | 71462fe4af5a6a24feadc57d0d8b8120bfddd85c /sample.pas |
migrate to gitlab
Diffstat (limited to 'sample.pas')
-rw-r--r-- | sample.pas | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sample.pas b/sample.pas new file mode 100644 index 0000000..ac6c4ad --- /dev/null +++ b/sample.pas @@ -0,0 +1,28 @@ +program HelloWorld(output); +begin + Write('Hello, world!') + {no ";" is required after the last statement of a block - + adding one adds a "null statement" to the program;} +end. + +procedure ThingOne; +begin + while a <> b do WriteLn('Waiting'); + + if a > b then WriteLn('Condition met') {no semicolon allowed!} + else WriteLn('Condition not met'); + + for i := 1 to 10 do {no semicolon for single statements allowed!} + WriteLn('Iteration: ', i); + + repeat + a := a + 1 + until a = 10; + + case i of + 0 : Write('zero'); + 1 : Write('one'); + 2 : Write('two'); + 3,4,5,6,7,8,9,10: Write('?') + end; +end. |