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

Reply

Join Date: Apr 2005
Posts: 9
Reputation: mpx10 is an unknown quantity at this point 
Solved Threads: 0
mpx10 mpx10 is offline Offline
Newbie Poster

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

 
0
  #1
Apr 10th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

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

 
0
  #2
Apr 11th, 2005
what is 'i' in that procedure? It's undefined...
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 9
Reputation: mpx10 is an unknown quantity at this point 
Solved Threads: 0
mpx10 mpx10 is offline Offline
Newbie Poster

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

 
0
  #3
Apr 11th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 9
Reputation: mpx10 is an unknown quantity at this point 
Solved Threads: 0
mpx10 mpx10 is offline Offline
Newbie Poster

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

 
0
  #4
Apr 11th, 2005
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;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC