On 16 Nov 2000, at 14:32, Eike Lange wrote:
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));
This seems to me to be an illegal assignment. AFAIK the compiler should reject it as an invalid variable reference.
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.24 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm