home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,204 of 2,978   
   Dave Langers to All   
   Re: strings, txt files,..... file not fo   
   24 Dec 04 14:13:47   
   
   From: spam.messages@annoy.us   
      
   > I'm a somewhat beginning programmer generally, so my   
   > problem is, as I guess, simple. I'm trying to write a   
   > program, which will open txt. files, of wich names it   
   > gets as strings from a specially intended for that  txt. file.   
   > To make that I used readln in a repetitive loop. Here's   
   > a sample:   
   > assign(shedule,'c:\shedule.txt);   
   > reset(shedule);   
   > for i:=1 to P do   
   >    begin   
   >       readln(shedule,file_name);   
   >       assign(file_,file_name);   
   >       reset(file_);   
   >       {here some other reading, letter counting, etc...}   
   >       close(file_);   
   >    end;   
   > And it works ok until const P not greater than 3.   
   > Otherwise-error 'file not found'. Let someone tell why,   
   > please.   
      
   Maybe "shedule.txt" is not formatted correctly? Maybe it contains too   
   few lines, or maybe there is a line that does not contain a valid   
   filename? There is probably something wrong on the 4th line I would say.   
      
   I further agree with matke that a "while not eof(shedule)" would be   
   better for your outer loop.   
      
   BTW, in this piece of code you forgot to close "shedule" properly.   
      
   --   
      M.vr.gr.   
      Dave   
      ("d-dot-langers-at-wxs-dot-nl")   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca