[fpc-pascal] Turbo Pascal Mode Bug?

Florian Klaempfl florian at freepascal.org
Mon Oct 1 17:46:56 CEST 2007


Zaka E-Lab schrieb:
> Hello,
> 
> I have a peace of code that demonstrates that in the TP mode of
> freepascal, one can use a function as a procedure.
> 
> Is this a bug or a normal behavior?

Normal because FPC emulates TP7, just add {$X+} in TP6 and you get the
same behaviour.

> 
> My University have replaced ( other time ) freepascal.org, and we
> must use the archaic Turbo Pascal 6.0, cause they say that freepascal
> don't respect the ISO Pascal.
> 
> I let you the code here:
> 
> program func_as_proc(input,output);
> 
> function pru_func:boolean;
> begin
>    writeln ('If I am printed, then you can use a function as a
> procedure.');
> 
>    pru_func := TRUE
> 
> end; { pru_func }
> 
> begin
>    (*
>     *  Prove if a function can be used as a procedure.
>     *)
>    pru_func;
> end.
> 
> Thanks in advance.
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list