Learn-Pascal
A repository for showcasing my knowledge of the Pascal programming language, and continuing to learn the language.
- Quiet · last change 11-13-2021
- ★ 9 on GitHub
README
Learning Pascal
2021 Basic syntax (pascal)
Testing basic syntax of Pascal
{ Start of script }
// Pascal comments are weird
{ This type of comment is even weirder, similar to (* *) in CAML }
program aboutPage(output);
begin
asm{ Assembly data? }// I know this line is not functional, take it out upon testing{ DO NOT USE return } 0101000 10101010 00011000 01101100 { Assembly data? } // I know this line is not functional, take it out upon testing
write('about:blank')
write('Lorem ipsum')
helloWorldOnTwoLines(); { DO NOT USE return }
break
END.
function helloWorldOnTwoLines();
begin
write('Hello-')
continue.
write('-world')
break; // Semicolons are recognized as null statements and are not needed
break;
end./!\ This example has not been tested yet, and may not work
I need feedback on any problems with this, this is basically all my Pascal knowledge as of 2021 Friday September 24th
Comments in Pascal
These are 2 types of comments in Pascal:
Block comments:
{ Block comment }
{ Write like
this as well } // I am not sure if this works/!\ This example has not been tested yet, and may not work
and Single Line comments:
// Single line commentHello World in Pascal
This is a simple Hello World program in Pascal:
begin
write('Hello World')
end./!\ This example has not been tested yet, and may not work
Functions in Pascal
This is a simple function in Pascal:
function helloWorldOnTwoLines();
begin
write('Hello-')
continue.
write('-world')
break; // Semicolons are recognized as null statements and are not needed
break;
end./!\ This example has not been tested yet, and may not work
Break keyword in Pascal
breakTo this day, I am still not entirely sure what the break keyword does, but most languages support it.
/!\ This example has not been tested yet, and may not work
Other knowledge of the Pascal programming language
- Most early Macintosh software was written in Pascal
- Pascal is NOT a curly bracket and semicolon language
- Pascal uses the
.pasfile extension, or the simpler.pfile extension - Pascal is similar in syntax to FORTRAN with the
beginandend.blocks - No other knowledge of Pascal to list.

