home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6810 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  1.0 KB

  1. Path: sparky!uunet!pipex!unipalm!uknet!warwick!cstaddc
  2. From: cstaddc@csv.warwick.ac.uk (Mr M A Stuart)
  3. Newsgroups: comp.lang.pascal
  4. Subject: ???????  User input of textfile to read ?????????
  5. Message-ID: <1en55vINN1u4@cumin.csv.warwick.ac.uk>
  6. Date: 22 Nov 92 05:17:50 GMT
  7. Organization: Computing Services, University of Warwick, UK
  8. Lines: 26
  9. NNTP-Posting-Host: cumin.csv.warwick.ac.uk
  10.  
  11.  
  12.  
  13.     Hi, I'm just getting to grips with pascal and have a niggling problem.
  14. I want to read in a filename using say :
  15.  
  16.     writeln(' Enter filename to read ');
  17.     readln(filename);
  18.  
  19. and take characters in from the specified file using :
  20.  
  21.     reset(filename)
  22.  
  23. Naturally filename must be of type : text.  This clashes with the first step
  24. where I assigned the name of the file to filename !!!
  25.  
  26.     i.e.   the variable filename must be :
  27.  
  28.      packed array (* to hold filename *)
  29.      file of text.  (* to access contents of file *)
  30.  
  31.  
  32.     Can anyone suggest a way around this problem or maybe a new approach to
  33. achieve the same result.
  34.  
  35.  
  36.     Thankyou very much for any help offered.
  37.