From: mmq_2002@onetel.net.uk (Qas)
Subject: weird compilation error...
Date: 8 Jan 2004 12:33:14 -0800
Date: 2004-01-08T12:33:14-08:00 [thread overview]
Message-ID: <c637494e.0401081233.1f0b7233@posting.google.com> (raw)
hello all,
(pascal) me again.bdw it wasn't hmwk last time just an excercise the
tutor hadnt talked about and wanted us to give a try in spare time.!
any how, i have this program and i want to enter the string i read
using get_line into an array. this how the program looks like(so far):
-------------------------------------
PROCEDURE Search1 IS
--subtype filename is string(1..3500);
-- File:Filename;
Max_Chars:Integer:=37;
Current_Line:String(1..Max_Chars);
SUBTYPE Stringy IS String (1..37);
TYPE Key_Array IS ARRAY (1 .. 101) OF stringy;
Files:Key_Array;
Line:Natural;
Count:Integer:=0;
Blank:CONSTANT Character:=' ';
Words:Integer:=0;
BEGIN
Openinput(Filename=>"filelist.txt");
--openoutput(filename=>"result.txt");
WHILE NOT End_Of_File LOOP
Get_Line(Item=>Current_Line, Last=>Line); --| i want to enter
this line into 1 element of the above array.how?
Put_Line(Item=>Current_Line(1..Line));
files:=current_line; --| here the compilation error occurs
Count:=Count+1;
END LOOP;
new_line;Put("COUNT ");Put(Count);
Closeinput;
--closeoutput;
END Search1;
-------------------------------------------
now the compilation error is this:
search1.adb:33:14: expected type "Key_Array" defined at line 16
search1.adb:33:14: found type "Standard.String"
now what does it mean by expected Key_array because as far as i can
understand the key_array is a string array. or are string arrays not
possible? if theyre not then will a record work?
so any other way of doing this
this is the format of the input file:
xxxxxxxyyyyyy EOL
sssssskkkkkkkdddddsss EOL
fffffffdddddd EOL
ffffffffffffffff EOL
each line is max 36 char but can be less
thanks for reading.
Qas
next reply other threads:[~2004-01-08 20:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-08 20:33 Qas [this message]
2004-01-08 21:13 ` weird compilation error Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox