iso10206 Seek Functions and a couple other little things....

Kevin A. Foss kfoss at mint.net
Thu Nov 27 15:11:09 CET 1997


On Thu, 27 Nov 1997 12:06:27 +0100 (MET), Peter Gerwinski wrote:

>I consider this a bug in GPC, but in fact I am not sure either what the
>EP standard really means.  Prospero's Extended Pascal compiler (PEP)
>rejects your code but it accepts the following:
[...]
(seekrd.pas)
>To fix GPC so it produces 'OK' from this source, edit the
>file `rts/rts-random.c' and comment out the `if' statement
>after "Seek back to the place ..." in `_p_seekread()' and
>in `_p_seekupdate()'.

Actually it works without patching the source because you are doing
non-continuous reads -e.g. using seekread() before each read().

>(* BTW, EP experts, if I write `Program Test ( Output, Data );',
>the program does *not* ask me for a file name for `Data' when
>compiled with PEP.  It works anyway, but I do not detect the
>data file on my hard disk afterwards.  What is the legal way
>to produce an external file in EP? *)

My understanding is that you have to bind a file name.  

Program Test ( Output, Data );

Var
  Data: bindable File [ 0..25 ] of Char;
  b : BindingType;
  C: Char;

begin
  b := binding (data);
  b.Name := 'data';
  bind(data, b);
[... rest of seekrd.pas]

But then again, I'm shooting in the dark, as I was with the seek*
calls, not having played around with extended Pascal features before.

-Kevin
--
Kevin A. Foss   ---   kfoss at mint.net
--




More information about the Gpc mailing list