Mariusz Zynel wrote:
First of all let me thank Authors for supplying SetTextBuf in GPC (20000401 snapshot). There are still, however, some BP functions missing in GPC: SeekEOLN, SeekEOF, Include and Exclude. Providing them in GPC would make porting from BP easier.
Thanks for the hint. In fact, Include and Exclude have been added on Feb 19, so if you have any luck with 20000401, you have these routines already...
Maybe the following code could be utilized:
const acTAB = #009; acLF = #010; acCR = #013; acWS = #032;
Just a few comments, no offense intended:
I think it's better not to assume a particular character encoding (even though it's unlikely to change nowadays). ' ' is probably easier than #32, and for Tab, LF and CR, GPC supports "\t", "\n" and "\r" (in the releases up to now only if `char-escapes' is enabled, starting from the next release always in double-quoted strings).
Also, it better to avoid `Seek'ing. It might be problematic on systems that have to do translation on text files (i.e., Dos -- but I don't feel like trying this out now), and is probably a little inefficient on any system. Since the BP routines actually skip the white space found, and Pascal provides look-ahead to the next character in text files with `FileVar^', seeking can easily be avoided here.
I've put similar code (BP compatible in that it treats everything < ' ' as white space) into the RTS now. However, in BP the argument is optional (and defaults to Input), so we need compiler magic in GPC to do this as well. Peter, will you do this (I hope it's easy to do, just like with a number of other I/O routines)?
Frank