Link to home
Start Free TrialLog in
Avatar of vyhoang
vyhoang

asked on

reading textfiles

When I run the program it has to read from a file called INVENTOR, so when the program exexutes and comes to the part where it has to read from the file it  displays
Input file `Inventor':
when i put inventor then press enter i get this message
./program: cannot open file `inventor' for reading (No such file or directory) (error #442 at 11c33)

i want it so the program just reads the file and not prompts me this (Input file `Inventor':) line
how do i fix this?

thanks
Avatar of Mike McCracken
Mike McCracken

This seems to be related to this question
https://www.experts-exchange.com/questions/20790139/Inventory-program.html


This sounds a lot like homework. It is agains EE policy for members to do homework OR for members to request solutions to homework. Has something to do the "academic honesty".

That said, what do you know how to do inPascal?  Show us your code so far and we would be happy to answer your specific questions.

Post the code you have written that is giving the trouble and we can try to help.

mlmcc

Avatar of vyhoang

ASKER

Procedure LoadFile;
BEGIN
   reset(INVENTOR);
   Count := 0;
   Sum := 0;
   WHILE NOT eof (INVENTOR) DO
   BEGIN
      readln(INVENTOR, id, instock, min, price, name);
      Count := Count + 1;
      Sum := Sum + price;
   end;
   writeln('There are ', Count, 'items in stock');
   writeln('The total retail is ', Sum);
end; { LoadFile }

I'm sorry i didn't know we had to post the code
This is a section of the code where the file is being loaded, the same problem applies, could you possible help me fix it
ASKER CERTIFIED SOLUTION
Avatar of dbrunton
dbrunton
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial