Cast Function to Procedure

Eike Lange eike.lange at uni-essen.de
Thu Nov 16 14:32:30 CET 2000


Hi!
I'm trying to cast a Function to a procedure, but my little
program fails with a "Segmentation fault".

Could anyone please tell me, what is wrong?

8<------- (snip) ----------------
Program TestIt;

Type
 bar = Procedure(a:Integer);

Var 
 BarFunc : bar;

Function FooFunc(a:Integer) : Integer;
Begin
  Writeln('I am of foo with:', a);
  FooFunc := a+1  
End;

Begin
  Writeln('FooFunc(3) is ', FooFunc(3));
  Writeln('now bar(FooFunc(2))');
  BarFunc := bar(FooFunc(2));
  BarFunc(2)
End.
------- (snap) ---------------->8

Thank you
Eike




More information about the Gpc mailing list