Glossary
- actual parameter
- A data item passed to a (formal) parameter in a procedure or function. Also called an argument.
- In the following line of code, the string Hello
World! is the actual parameter:
writeln('Hello World!');
- addressing mode
- Defines how a low-level language instruction identifies its operand (or operands).
- Immediate addressing, indexed addressing, direct addressing, indirect addressing, relative addressing
See in the In-line Assembler tutorial
- algorithm
- A set of steps for solving a problem.
- append
- Add data to the end of an existing textfile.
append(SurnameFile); writeln(SurnameFile, 'Gee');
- application
- Software that carries out a task that would be necessary in the absence of computers (e.g. keeping accounts).
- Microsoft® Word is an application (or applications program).
- argument
- A data item passed to a (formal) parameter in a procedure or function. Also called an actual parameter.
- In the following line of code, the string Hello
World! is the actual parameter:
writeln('Hello World!');
- array
- A data structure that contains multiple items of the same type of data.
- The following code declares that ClassForenames
is an array:
var ClassForenames : array [1..31] of string;
- ASCII
- American Standard Code for Information Interchange. Characters (letters, digits, spaces, punctuation marks and non-printing control characters) are represented by a 7-bit code. Extended ASCII uses an 8-bit code.
- The ASCII code for the letter A is 65.
- asm
- The Pascal keyword for the start of a section of code written in assembly language.
- In an asm block, the block begins with reserved word asm and ends with end;
asm ADD EAX, 23 MOV ECX, 0 end;
- assembler
- A program that translates a program written in assembly language into machine code.
- assembly language
- A programming language in which the instructions are closely related to the computer being programmed. Examples of assembly language instructions:
-
ADD EAX, 23 MOV ECX, 0
See the In-line Assembler tutorial. - assignment
- An operation that gives a value to a variable.
-
Number1 := 53; Answer := Number1 * 5;
- binary
- Base two. A number representation consisting of zeros and ones used by nearly all computers.
-
01010111 is the binary representation of 87 in denary (decimal).
01010111base 2 = 26 + 24 + 22 + 21 + 20 = 64 + 16 + 4 + 2 + 1 = 87
- Boolean data
- Data that can have one of two values (True or False).
- In the following, Found is Boolean data.
Found := FALSE;
- Boolean expression
- Any expression which can be evaluated as being True or False.
Total = 100
- Boolean operator
- An operator that acts on Boolean (True/False) values. It is also called a logical operator.
- NOT, AND, OR
- byte
- An integer type supporting values 0 to 255.
- cardinal
- In Delphi™, the basic unsigned integer type.
- var Cardinal1 : Cardinal = 400000;
- case statement
- A selection statement allowing one of several groups of statements to be executed depending on the data being processed.
-
case MenuChoice of 1 : PrintRecords; 2 : Display; 3 : Exit; end;
See the Selection Statements tutorial. - character check
- A validation check in which characters must conform to one or more rules.
- Surname to contain letters. Hyphen and/or apostrophe permitted.
See Character Check in the Validation tutorial.
- check digit
- An extra calculated digit added to the end of a code number. The extra digit is calculated from the other digits of the code number.
- The final digit in a product code printed under a barcode.
See Check Digit in the Validation tutorial.
- compilation error
- An error that prevents a a piece of computer program source code from compiling. It is usually a syntax error in the source code but could be an error in the compiler code.
- Count = 0 instead of Count := 0
- compiler
- A program that translates a high-level language program into machine code or some other low level language.
- Before you can run a Pascal program, it has to be compiled using a compiler.
- compiler directive
- A statement in a program that affects the translation process.
-
{$Apptype Console}
- console application
- A program designed to be used via a text-only computer interface.
- constant
- A data item with a fixed value. It can be initialised at the start of the program, but after that its value does not change.
- In the following code, VAT_RATE is declared to be
a constant, and assigned the value 0.175
const VAT_RATE = 0.175; HOURLY_MIN = 4.75;
- CSV file
- A text file with one record per line and each field separated from the next by a comma. CSV stands for comma-separated values.
- debugging
- The detection, location and correction of faults in a program or system.
- Delphi™
- Object oriented Pascal developed by Borland.
- dereference
- Access the data to which a pointer is referring. Append a caret to the name of a pointer to dereference it.
FirstRec^.Surname := 'Sugar';
See Linked Lists and demonstration programs in the Lists, Stacks and Queues tutorial.- direct addressing
- The use of an operand as the address of data in a low-level language instruction.
- MOV Product, EAX
where Product is a variable representing an address. See Addressing Modes in the In-line Assembler tutorial.
- DIV
- The operator for integer division.
A := 21 DIV 4;
(A becomes 5).A := 23 DIV 4;
(A still becomes 5 because the remainder is discarded).- enumerated type
- A type which includes in its definition a list of all of the possible values for variables of that type.
- TSuit = (Clubs, Diamonds, Hearts, Spades);
See the Enumerated Types tutorial.
- executable
- A binary file containing a program in machine language which is ready to be executed (run).
- HelloWorld.exe
- expression
- A combination of symbols that returns a value when executed.
- Num1 + Num2
- field
- Part of a record used to store a single data item of a particular type.
- The Surname string field in a student record.
- file (1)
- A unit of data storage used by the operating system for organisation.
- Introduction.doc
- file (2)
- A collection of related records.
-
StudentFile : file of Tstudent;
See Output to File and Input from File in the Input and Output tutorial. - float
- As used in the floatToStr function, a number of type real. (The name is derived from floating point number, which comprises a mantissa and an exponent).
-
Radius := 56.23;
- format check
- A validation check to ensure that the characters conform to some defined pattern.
- A national insurance number must have 2 letters followed by 6 digits followed by a single letter. See Format Check in the Validation tutorial.
- function
- A subroutine that returns a value.
- The function
trunc drops the fractional part of its argument,
and returns the whole part:
intNum := trunc(realNum);
See Functions and Return Values in the Procedures and Functions tutorial for the declaration and calling of your own functions. - global variable
- A variable that can be used anywhere in a program.
- hard-coded
- Applies to assumptions built into a program, possibly in multiple places, where they cannot be easily modified.
-
In the following code the number of items per pack is hard-coded to be two.
PackWeight := 2 * SINGLE_WEIGHT;
If the number of items per pack is later changed to four, it is impractical to change every '2' into a '4' because in many instances the '2' will have nothing to do with the number of items in a pack. It would be much easier to make the changes if a named constant were used instead:
PackWeight := NUMBER_PER_PACK * SINGLE_WEIGHT;
- high-level language
- A programming language that is expressed in statements closer to a human language than is a (low-level) machine language.
- Pascal
- IDE
- See Integrated Development Environment.
- Lazarus and Delphi™ are IDEs.
- identifier
- The name given to a variable, constant or subroutine etc.
- UserAnswer
- if statement
- A statement that allows selection.
-
if UserAnswer = Sum then inc(Score);
See the Selection Statements tutorial. - immediate addressing
- The use of an operand as a value (a constant) in a low-level language instruction.
- MOV EAX, 34
This statement loads the denary value 34 into the accumulator. See also Addressing Modes in the In-line Assembler tutorial
- index (1)
- (of an array) An integer which identifies an array element.
- In the following code, the value 5 is used as an
index to the array Students, identifying the fifth
element in the array.
Students[5]:= 'Hunt';
- index (2)
- (of an indexed sequential file) Table of locations of selected key field data used to speed up searching.
- An index to store the location of the record containing the first surname beginning with A then the location of the record containing the first surname beginning with B etc.
- indexed addressing
- The use of an address calculated by applying an offset (contained in the index register), to an address operand in a low-level language instruction.
- MOV [ECX + ByteArray], DL //Contents of DL moves into indexed address
See Addressing Modes in the In-line Assembler tutorial.
- indirect addressing
- The use of an operand to store the address of data in a low-level language instruction.
LEA EAX, Int1; // Load the address of Int1 into the accumulator. MOV [EAX], EDX; // Copy the contents of EDX to Int1 using indirect addressing.
In this example the accumulator (EAX register) stores the address rather than the value of Int1. See Addressing Modes in the In-line Assembler tutorial.- integer (1)
- A whole number. There are several inbuilt types (such as byte, shortint, smallint and integer) for data conforming to this general definition.
- 15, 985672, -86
- integer (2)
- A type predefined in current Pascal to occupy four bytes and to be signed (can be positive or negative).
- var Int1 : integer = 651;
- integer division
- Division of one integer by another to give the integer quotient (the whole number element of the result) and the remainder. In Pascal, the DIV operator returns the integer quotient and the MOD operator returns the remainder.
Quotient := 22 DIV 7; Remainder := 22 MOD 7;
Quotient becomes 3 and Remainder becomes 1.- integrated development environment (IDE)
- IDEs typically include (1) an editor with syntax highlighting, (2) integrated support for compiling and running the program and (3) a means of relating compilation errors back to the source code in order to facilitate debugging.
- Lazarus and Delphi™ are IDEs.
- interpreter
- A program that translates and executes another program one line at a time.
- iteration
- Repetition of a sequence of steps until a condition is satisfied or while a condition is satisfied.
repeat Product := Product * 2; until Product > 1000;
See the Iteration tutorial.- keyword
- Any word in a programming language that can have only the meaning defined in that language. Also called reserved word. The compiler checks that no identifier has been given the name of a keyword such as begin.
- Lazarus
- A free and open source IDE for creating console and graphical Pascal and Object Pascal applications. It is a development tool for the free and open source Free Pascal compiler.
- length check
- A validation check to ensure that data in a string field is of a reasonable length.
- A new ISBN number must be accepted only if it has 13 characters.
See Length Check in the Validation tutorial.
- list
- An ordered collection of data items.
const rainbow : array[1..7] of string =('red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet');
- linked list
- A dynamic data structure used to hold a sequence.
- See Linked Lists in the Lists, Stacks and Queues tutorial.
- literal
- A constant made available to a program by direct inclusion in the source code.
- In the following code, Hello is a string literal, and
3.142 is a numerical
literal.
writeln('Hello'); Area := 3.142 * r * r;
- local variable
- A variable declared in a program block (such as a procedure or function) and accessible only within that program block. The variable is said to have local scope.
procedure Display; var Count : integer;
- logic error
- A mistake made by the programmer when designing the code, which compiles and runs but produces an incorrect output.
- Celsius := Fahrenheit - 32 * 5 / 9;
- logical operator
- An operator used for actions on Boolean (True/False) values. It is also called a Boolean operator.
- NOT, AND, OR
- loop
- A sequence of instructions that may be executed repeatedly by the processor.
repeat Product := Product * 2; until Product > 1000;
- maximise a window
- When a window is maximised it is given its maximum size. To do this, click on the Maximize icon
(with tooltip "Maximize"
) near the top right of the window.
- minimise a window
- When a window is minimised it is replaced by an icon on the task bar. To do this, click on the Minimize icon
near the top right of the window.
- MMX™
- The MultiMedia eXtension in Intel® microprocessors that contains additional instructions for rapid processing of graphical and other data. It enables array processing of short arrays.
- MOD
- The operator giving the remainder after integer division.
Remainder := 21 MOD 4;
(Remainder becomes 1).- object Pascal
- Object-oriented Pascal, designed for graphical applications and hence rapid application development.
- Delphi
- operand (1)
- An object acted on by an operator. It may be a literal value, a declared constant, a variable or the value of another expression.
- Num1 + Num2
Num1 and Num2 are operands in this expression.
- operand (2)
- In a low-level language instruction, an item of data or address of data that the operation acts on.
- MOV EAX, 15
EAX and 15 are operands of the operation with opcode MOV.
- operating system
- The collection of systems software that manages the computer.
- Microsoft® Windows®, UNIX®, Linux® and Leopard® are all operating systems.
- operator
- A symbol (comprising one or more characters) representing an action to be performed on one or more operands to produce a value.
- Num1 + Num2
The operator in this expression is +.
See the Operators tutorial.
- ordinal
- An ordered set of values.
- Integer, char
- parameter
- In Pascal there are two types of parameters, 'Formal' and 'Actual'. Formal parameters are listed in the procedure heading, when the subroutine or function is declared. Actual parameters appear when the function or subroutine is called (used). The formal and actual parameters must match in number and type.
-
function Cube(Num : real): real;
- Pascal
- A high-level programming language designed to teach programming. It emphasises types and structures of data and structured programming.
- pass by reference
- Supply the address of a variable as an argument to a procedure. The effect is that changes made to the variable parameter will also be made to the global variable that was passed to the procedure.
procedure InputChoice(var Choice : integer);,
called with the statement InputChoice(Choice);, where Choice is the global variable that is changed by the procedure.- pass by value
- Supply the value of a variable as an argument to a procedure. The effect is that changes made to the local variable do not affect the variable that was passed to the procedure.
procedure Calculate(GrandTotal : real);,
called with the statement Calculate(Total);, where Total is a global variable that remains unchanged by the procedure.- pointer
- A variable that denotes a memory address.
- In the following example, PtrRec is a type of pointer that points to a record of type TRec and PtrFirst is a pointer to this type of record.
type PtrRec = ^TRec; TRec = record Surname : string[15]; Score : integer; Next : PtrRec; end; var FirstRec : PtrRec; begin //Assign a new record of type TRec to FirstRec FirstRec := new(PtrRec);
See Linked Lists in the Lists, Stacks and Queues tutorial. - precedence of operators
- The order in which operations are carried out when there is more than one operator in an expression.
- v := u + a * t;
Multiplication has greater precedence than addition.
See the Operators tutorial for the precedence of different types of operator.
- presence check
- A validation check to ensure that the value of a required input has been entered.
repeat write('Please enter your surname. '); readln(Surname); until length(Surname) > 0;
- procedure
- A named sequence of statements, often with associated constants, data types and data structures, that usually performs a single task.
- procedure LineOfChars(NumberOfChars : integer; Character : char);
See the Procedures and Functions tutorial.
- program
- A complete set of program instructions written to perform a task.
- pseudocode
- A description of an algorithm that, although it cannot be compiled, uses control structures and keywords similar to those of a programming language. It is used for documenting algorithms and for outlining the structure of programs before coding (without the need for strict adherence to syntax).
- queue
- A data structure in which data items are added only at the rear of the list and removed only from the head. It is a FIFO (first in first out) data structure.
- The keyboard buffer is a queue. See also Queues in the Lists, Stacks and Queues tutorial.
- range check
- A validation check on numbers or codes to ensure that they are in the permitted range.
repeat write('Age of student? '); readln(Age); until (Age > 10) and (Age < 20);
See Range Check in the Validation tutorial.- real
- A type of number which may have a decimal part.
y := ln(x);
y must be declared as real because it may have a decimal part.- record
- An organised collection of data about one item or individual.
- See the Records tutorial.
- recursive
- See Recursive.
- See also, stopping condition. Oops, too late!
See the Recursion tutorial for the theory of recursion and programs with recursive routines.
- relational operator
- An operator that compares data and returns True or False.
= (is equal to)
<> (is not equal to)
> (is greater than)
<= (is less than or equal to)- repetition
- Same as iteration: repeating a sequence of instructions until a condition is satisfied or while a condition is satisfied.
repeat Product := Product * 2; until Product > 1000;
See the Iteration tutorial.- reserved word
- Any word in a programming language that can have only the specific meaning defined for it in that language. Also called a keyword. When you name a variable you are not allowed to use any of the reserved words.
- The compiler checks that no identifier has been given the name of a keyword such as begin.
- restore down a window
- When a window is restored down it is changed from having maximum size down to a
reduced size. The reduced size is normally adjustable,
and it makes it easier to change the layout of windows on your desktop,
so that you can work in one while still seeing contents of other windows.
To reduce the size of a maximised window, click on the Restore Down icon
near the top right of the window.
- routine
- A section of code within a program, usually with an identifier that can be used to execute it. Procedures and functions are routines. Similar to a subroutine.
procedure Hello; var Forename : string; begin write('What is your first name? '); readln(Forename); writeln('Hello, ', Forename); end;
See the Procedures and Functions tutorial.- run time
- The period of time during which a program is being executed, as opposed to being compiled or loaded.
- run-time error
- Error detected during program execution.
- Letter 'a' entered and assigned to integer variable (in the absence of type check).
- scope of variable
- The accessibility of the variable.
- The scope of a local variable is the subroutine in which it is declared.
- selection
- A decision-making step (if statement or case statement).
if not Found then writeln('Not found.');
See the Selection Statements tutorial.- sequence
- Consecutive statements processed in order.
write('What is your first name? '); readln(Forename); writeln('Hello, ', Forename);
- set
- An unordered collection of different values of the same ordinal type.
type TCapsSet = set of 'A' .. 'Z'; var MyCapsSet : TCapsSet = ['C', 'O', 'M'];
See the Sets tutorial.- source code
- Usually a high-level language program, but could be assembly code if you write it.
- You write Pascal source code in Lazarus and Delphi™ editors.
- stack
- A LIFO (last in first out) data structure. At any instant, the only data item that can be removed from the stack is the most recent item to have been added.
- Stacks are used for storing return addresses for procedures. See also Stacks in the Lists, Stacks and Queues tutorial.
- statement
- An instruction in a program written in a high-level language.
- y := m * x + c;
- stopping condition
- In a recursive procedure or function, the necessary condition which causes it to exit rather than call itself again.
-
function Factorial(i : integer) : int64; begin if i = 0 then result := 1 else result := i * Factorial(i - 1); end;
See the Recursion tutorial. - string
- A data type consisting of a sequence of characters.
- 'Hello World!'
See String Variables.
- structured English
- The use of the English language with the control structures of structured programming in order to describe an algorithm. This tends to be further from the actual code than is pseudocode and easier to read by a non-specialist.
- MULTIPLY Length by Breadth to get Area
- subroutine
- A section of code within a program that can be executed by using its identifier. Procedures and functions are subroutines. Similar to a routine.
-
intNum := trunc(realNum);
See how to declare and call your own subroutines in the Procedures and Functions tutorial. - symbol
- One or more characters representing an operator, value, constant, variable or subroutine.
- :=
- syntax
- The precisely structured way in which program statements must be written in order to be compiled.
- The separation of statements by a semicolon is an example of Pascal syntax.
- syntax error
- An error that results when the source code does not obey the rules of the language.
for Count = 1 to 5 …
instead of
for Count := 1 to 5 …- syntax highlighting
- Displaying text (especially source code) in different colours, fonts and styles according to the category of terms.
-
uses Classes, SysUtils;
- translator
- A computer program to convert instructions from one language to another. This general term covers assemblers, compilers and interpreters.
- The Free Pascal compiler used by Lazarus
- type check
- A validation check to ensure that a data item is of the correct data type.
- Rainfall to the nearest mm must be accepted only if it is an integer.
See Type Check in the Validation tutorial.
- Unicode
- A character code that usually uses 16 bits to represent a character. It defines every character in most of the languages in the world.
- validation
- The checking of data to see if it is sensible in the context being used. Rules are chosen at design time (e.g. a quantity must be numeric).
-
repeat write('Month number? '); readln(MonthNum); until MonthNum in [1..12];
See the Validation tutorial. - variable
- A named memory location in which a program can store one or more data values.
- var Scores : array[1..20] of integer;
- variable parameter
- A parameter used in a procedure when the argument passed to it is an address of a variable (passing by reference). The effect is that changes made to the variable parameter will also be made to the global variable that was passed to the procedure.
procedure InputChoice(var Choice : integer);,
called with the statement InputChoice(Choice);, where Choice is the global variable that is changed by the procedure.- verification
- Usually the process of entering the data twice, with the second entry being compared with the first to detect a keying error.
- Keying a new password twice.
- white space
- Any single character or series of characters that represents horizontal and/or vertical space.
- Carriage-return-line-feed represented by #13#10.
- write
- An inbuilt procedure that outputs data without adding an end-of-line marker, so that the next piece of output or input will be on the same line.
-
write('Enter date: ');
- writeln
- An inbuilt procedure that outputs data followed by an end-of-line marker such as carriage return/line feed, so that the next piece of output or input will be on the next line.
-
writeln('Hello World!');