Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-01

Turbo Pascal mode!!

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zaka E-Lab

Some time ago, I posted about this.

On the TP mode FreePascal can use a function as a procedure. Florian told me that that was because of the version of the TP emulation. Well, after that, I was happy with that until now. I discovered that, even adding {$x-} to the code, if you put a function inside a "for" or an "if" you can use a function as a procedure:

********************************************************************
program pru_funcion_como_procedimiento (input,output);
{$x-}
function pru_func:boolean;
begin
    writeln ('Hola programador.');
    pru_func := TRUE;
end; { pru_func }
procedure pru;
var
    i : integer;
begin
    for i:=1 to 10 do
       pru_func;
end; { pru }
begin
    pru;
end.
*********************************************************************

Is this still normal behaviour?

I hope this helps anybody.

Zaka.