: First...I don't know what the error means but...could someone please offer me a hand as to why the error is there and how I can get rid of it to finish this program. Remember, this is just a fragment so far...
:
: PROGRAM Charges;
: USES CRT;
:
: VAR
:
: UserAccount : String[5];
: PriorityCode, NumberCustomer : Integer;
: UseHours, HourCharge, AveCharge, PriorityCharge, TotalCharge : Real;
:
: Procedure Headings;
:
: Begin
:
: Writeln(' Apex Computer Service');
: Writeln;
: Writeln(' Account Charge');
: Writeln(' --------- --------');
:
: End;
:
: Procedure GetInfo;
:
: Begin
:
: Writeln(' Please Input Your User Account Number: ');
: Readln(UserAccount);
: Writeln(' Please Input Your Priority Code: ');
: Readln(PriorityCode);
: Writeln(' Please Input Your Hours of Usage: ');
: Readln(UseHours);
:
: End;
:
: Procedure LoopingIt;
:
: Begin
:
: WHILE UserAccount <> 'xxxxx' DO
:
: Begin
:
: IF (UseHours > 15.00) THEN
: HourCharge := (225.00 + (15.00 * UseHours))
:
: ELSE (UseHours > 5.00) AND (UseHours <= 15.00)
: HourCharge := (100.00 + (25.00 * UseHours))
:
: ELSE
: HourCharge := 100.00;
:
: End;
: End;
: End;
:
: BEGIN
:
: CLRSCR;
: Headings;
: GetInfo;
: LoopingIt;
: CalcCharge;
:
: END.
:
:
The "Invalid Variable Reference" means that the compiler cannot a certain statement, unless the variables it uses are of identical formats.
Given the fact that you want us to guess where the error occurred, my guess is that it occurred in the while-do. You could try to solve it by changing the type of the UserAccount into a normal string.
Also you have created an infinite loop, because the user cannot change the UserAccount from within the while-do.