Concept | Example |
Debugging | To set a breakpoint click the margin F9 = Start Run or Continue if paused F8 = Step Single Line F7 = Step Into |
Built-in Subroutines | Writeln('Answer to life, ', 'the universe, and everything = ',4,X); Readln; |
Other Common Subroutines | Refer to Section 2.7 for more details. |
Declarations | var VariableName : VariableType; const ConstantName = ConstantValue; ConstantName : ConstantType = ConstantValue; |
Operators | := // Assignment + - * / // Add subtract multiply divide div // Integer division mod // Modular division and // Logical and (TRUE and FALSE = FALSE) or // Logical or // (TRUE or FALSE = TRUE) // (TRUE or TRUE = TRUE) xor // Logical exclusive or // (TRUE xor FALSE = TRUE) // (TRUE or TRUE = FALSE) not // Logical negation > // Greater than >= // Greater than or equal < // Less than <= // Less than or equal = // Equal to <> // Not equal to |
Conditional Statements | if Condition then StatementForTrueCondition else StatementForFalseCondition; case OrdinalExpression of ConstantExpr1: Statement1; ConstantExpr2: Statement2; ... ConstantExprN: StatementN; else OtherwiseStatement; end; |
Loop Statements | for ControlVariable := Start to Stop do begin end for ControlVariable := Stop downto Start do begin end while Condition do begin end repeat until Condition Break Continue |
Subroutine Declarations | procedure ProcedureName(Argument1Name : Argument1Type; Argument2Name, Argument3Name : Argument2And3SameType); begin {Code to be executed} end; function FunctionName(Argument1Name : Argument1Type; Argument2Name : Argument2Type) : FunctionResultType; begin {Code to be executed} Result := ReturnValue; end; |
Unit Declarations | unit UnitName; interface uses {Units used by interface here}; implementation uses {Units used by implementation here}; initialization {Optional initialization section.} finalization {Optional finalization section.} end. |