pascal cheat sheet for programmers

if condition then begin statement(s) end;
if condition then statement;

3.67
3
Joe.Z 70 points

                                    while condition do begin statement(s) end;
while condition do statement;

3.67 (3 Votes)
0
4.14
7
Slobster 115 points

                                    repeat statement(s) until condition;

4.14 (7 Votes)
0
4
1
Collin Day 110 points

                                    program Addition;

// Link the SysUtils file for access to file handling routines
uses
  SysUtils;

// Declare some variables
var
  LIn, LOut: Text;         // References to the input and output files
  LVar1, LVar2: integer;   // The two values that are to be added together
  LResult: integer;        // The result

begin

  // Open the input file
  Assign(LIn, 'addin.txt');
  Reset(LIn);

  // Read the input values
  ReadLn(LIn, LVar1, LVar2);

  // Open the output file
  Assign(LOut, 'addout.txt');
  ReWrite(LOut);

  // Calculate the result
  LResult:= LVar1 + LVar2;

  // Write to output file
  WriteLn(LOut, LResult);

  // Cleanup
  CloseFile(LIn);
  CloseFile(LOut);

end.

4 (1 Votes)
0
4.4
5
Phil652 125 points

                                    with variable do begin statement(s) end;
with variable do statement;

4.4 (5 Votes)
0
Are there any code examples left?
New code examples in category Pascal
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source