Variable names are a maximum of 32 alphanumeric characters. Some Pascal versions only recognise the first eight characters. The first letter of the data name must be ALPHABETIC (ie A to Z ). Lowercase characters ( a to z ) are treated as uppercase. Examples of variable names are,
RATE_OF_PAY HOURS_WORKED B41 X y Home_scoreGive variables meaningful names, which will help to make the program easier to read and follow. This simplifies the task of error correction.
ASSIGNING VALUES TO VARIABLES
Having declared a variable, you often want to make it equal to some value. In pascal, the special operator
:=provides a means of assigning a value to a variable. The following portion of code, which appeared earlier, illustrates this.
When assigning values to char vari
var number1, number2, number3 : integer;
begin
number1 := 43; { make number1 equal to 43 decimal }
number2 := 34; { make number2 equal to 34 decimal }
number3 := number1 + number2; { number3 equals 77 }