home *** CD-ROM | disk | FTP | other *** search
-
- Listing 10
-
- {*
- * read_id skips whitespace character and reads an
- * identifier from file f into string s.
- *}
- procedure read_id(var f : text; var s : string);
- var
- c : char;
- begin
- s := '';
- if seekeof(f) then
- ;
- read(c);
- if c in ['A'..'Z', 'a'..'z', '_'] then
- begin
- repeat
- s := s + c;
- read(c);
- until not (c in ['A'..'Z', 'a'..'z', '0'..'9', '_']);
- end;
- unread(f);
- end;
-
-