Pascal - Identifiers

From SwinBrain

Identifiers are used in programming languages to "identify" or name a keyword, variable, constant, function, procedure, type, or program.

Identifiers

Identifiers in pascal can have up to 255 significant characters, meaning that the first 255 characters of each identifier must be unique. Identifiers in pascal must abide by the following syntax diagram.

ref8x.png

Here are some examples of valid identifiers.

Example Identifiers
program PI then addStudent
CalculateCircleArea age else calculateAge
radius if _245 Student


Reserved Words

A reserved word is a valid identifier that is used to identify something within the programming language itself. This means that these identifiers cannot be used to identify variables, etc. within your programs.

Reserved Words by Language
Turbo Pascal Delphi Free Pascal
absolute All from Turbo Pascal, plus All from Turbo Pascal, plus
and as All from Delphi, plus
array class dispose
asm except exit
begin exports false
break finalization new
case finally true
const initialization
constructor is
continue library
destructor on
div property
do raise
downto threadvar
else try
end
file
for
function
goto
if
implementation
in
inherited
inline
interface
label
mod
nil
not
object
of
on
operator
or
packed
procedure
program
record
repeat
self
set
shl
shr
string
then
to
type
unit
until
uses
var
while
with
xor .


Modifiers

Pascal also has the following modifiers. These identifiers have special meaning to the compiler, but can also be used as identifiers within your programs. As these do have special meaning to the compiler they are best avoided as identifiers within your programs.

Pascal Modifiers
absolute far pascal safecall
abstract far16 popstack saveregisters
alias forward private softfloat
assembler fpccall protected stdcall
cdecl index public virtual
default name published write
export near read  
external override register  


Note: Predefined types such as Byte, Boolean and constants such as maxint are not reserved words. They are identifiers, declared in the system unit. This means that these types can be redefined in other units. The programmer is, however, not encouraged to do this, as it will cause a lot of confusion.

[edit]Pascal: Programs | Functions and Procedures | Statements | Data Types | Identifiers | ...
Links: Topic Brains
Return to Swin Brain