Learn Pascal
1B - Identifiers

Identifiers are names that allow you to reference stored values, such as variables and constants. Also, every program must be identified (hence the name) by an identifier.

Rules for identifiers:

Pascal implementations may differ in their rules on special characters, especially the underscore.

Several identifiers are reserved in Pascal -- you cannot use them as your own identifiers. They are:

andarray begincase constdiv dodownto
elseendfilefor forwardfunctiongotoif
inlabelmodnil notoforpacked
procedureprogramrecordrepeat setthentotype
untilvarwhilewith

Also, Pascal has several pre-defined identifiers. You can replace them with your own definitions, but then you would remove part of the functionality of Pascal.

absarctan booleanchar cosdispose eofeoln
expfalseinputinteger lnmaxintnewodd
ordoutputpackpage predreadreadlnreal
resetrewriteroundsin sqrsqrtsucctext
truetruncwritewriteln

Pascal is not case sensitive! MyProgram, MYPROGRAM, and mYpRoGrAm are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization! Because C, C++, and Java, the dominant programming languages of today, are case- sensitive, future Pascal implementations may become case-sensitive.

Identifiers can be any length, but some Pascal compilers will only look at the first several characters. Supposing this number is 32. Then,
     ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFAlphaBeta
     ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGammaDelta

would be equivalent.

One usually does not push the rules with extremely long identifiers or loads of special characters, since it does not confer much benefit on the program's functionality. Also, staying well within the bounds of identifier rules will aid cross-platform compatibility. Most programmers make do with just alphanumeric characters.