Code Monkey home page Code Monkey logo

learn-pascal's Introduction


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 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 comment

Hello 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

break

To 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

  1. Most early Macintosh software was written in Pascal

  2. Pascal is NOT a curly bracket and semicolon language

  3. Pascal uses the .pas file extension, or the simpler .p file extension

  4. Pascal is similar in syntax to FORTRAN with the begin and end. blocks

  5. No other knowledge of Pascal to list.


learn-pascal's People

Contributors

seanpm2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.