944,022 Members | Top Members by Rank

Ad:
Apr 10th, 2005
0

error 88:'(' expected when trying to display an array any help

Expand Post »
i have designed a database an one of my feilds is set up as an array. i had no problems reading my data into the array but i am having trouble trying to display the feild. when compiling the following error occurs.

error 88 expected (.
the error occurs in the section where the text color has been changed

below are the sections that i think are relevant to the problem:

program ordering;
uses crt;
type ordertype = array[1..8] of string[25];

order = record
memberid:string[10];
orderref:string[10];
address1:string[20];
noveg:integer;
nononveg:integer;
orderdate:string[10];
orderdetail : ordertype ;
pricepp:real;
totalprice:real;
discount:string[3];
finalprice:real;
end;
intfiletype1 = file of order;
extfilenametype1 = string [25];


procedure enterrecdata1 (var memrecord : order);
var i:integer;
hold: ordertype;
begin
writeln;
with memrecord do
begin
writeln ('Enter Member ID: ');
write ('Press the enter key to end input:');
readln (memberid);
if memberid <> ''
then
begin
write ('Enter Order Ref: ');
readln (orderref);
write ('Enter number of veggie people: ');
readln (noveg);
write ('Enter number of non veg: ');
readln (nononveg);
write ('Enter date of order: ');
readln (orderdate);
write ('Enter order: ');
for i:= 1 to 8 do
readln (orderdetail[I]);
write ('Enter price per person: ');
readln (pricepp);
totalprice:=((nononveg) + (noveg)) * (pricepp) ;
writeln ('Discount?: ');
write ('*If yes type Y If no type N*');
readln (discount);
if discount = 'n' then (finalprice) := (totalprice)
else finalprice := totalprice * 0.90
end
end
end;

procedure display1;

var memrecord : order;
intfile : intfiletype1;
masterfile : extfilenametype1;
x:integer;
begin
clrscr;
gotoXY (15,1);
writeln ('-----MEMBERS FILE-----');
gotoXY (10,3);
getmasterfilename1 (masterfile);
gotoXY (1,5);
assign (intfile, masterfile);
reset (intfile);
while not eof (intfile) do
begin
read (intfile, memrecord);
with memrecord do
begin
x:=0;
repeat
clrscr;
writeln ('Member ID: ',memberid);
writeln ('Order REF: ',orderref);
writeln('Number of veg People: ' ,noveg);
writeln('Number of Non veg people: ' ,nononveg);
writeln ('Date of order: ',orderdate);
writeln ('Order: ',ordertype[i]);
writeln('Price per Person:œ',pricepp:8:2);
writeln('Total Price:œ',totalprice:8:2);
writeln('Discount?: ',discount);
writeln('Final Price: œ',finalprice:8:2);
x:=x+1
until (x=8) or (eof(intfile));
readln;
end
end;

please help!! thank you
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mpx10 is offline Offline
9 posts
since Apr 2005
Apr 11th, 2005
0

Re: error 88:'(' expected when trying to display an array any help

what is 'i' in that procedure? It's undefined...
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 11th, 2005
0

Re: error 88:'(' expected when trying to display an array any help

i have now defined 'i' as an integer as it is above in procedure enterrecdata1 but still the same error occurs. any more ideas thanks for the help jwenting
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mpx10 is offline Offline
9 posts
since Apr 2005
Apr 11th, 2005
0

Re: error 88:'(' expected when trying to display an array any help

i have solved the problem the following code is correct. the highlighted section is the changed part.

procedure display1;

var memrecord : order;
intfile : intfiletype1;
masterfile : extfilenametype1;
x:integer;
begin
clrscr;
gotoXY (15,1);
writeln ('-----MEMBERS FILE-----');
gotoXY (10,3);
getmasterfilename1 (masterfile);
gotoXY (1,5);
assign (intfile, masterfile);
reset (intfile);
while not eof (intfile) do
begin
read (intfile, memrecord);
with memrecord do
begin
x:=0;
repeat
clrscr;
writeln ('Member ID: ',memberid);
writeln ('Order REF: ',orderref);
writeln('Number of veg People: ' ,noveg);
writeln('Number of Non veg people: ' ,nononveg);
writeln ('Date of order: ',orderdate);
for i := 1 to 8 do
writeln ('Order: ',orderdetail[i]);
writeln('Price per Person:œ',pricepp:8:2);
writeln('Total Price:œ',totalprice:8:2);
writeln('Discount?: ',discount);
writeln('Final Price: œ',finalprice:8:2);
x:=x+1
until (x=8) or (eof(intfile));
readln;
end
end;
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mpx10 is offline Offline
9 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: problems with copying fields can someone help
Next Thread in Pascal and Delphi Forum Timeline: printing from pascal





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC