On Thu, Nov 16, 2000 at 03:19:53PM -0800, Russ Whitaker wrote:
This looks like trying to use a proceedure as a function, which is a no-no. If you want to use a function as a proceedure why not just do it? The compiler will complain with a warning message, but it works.
It wasn't as trivial as shown here. I would like to use this function (after cast) as a parameter to an other function which needs a precedural-parameter like
Function foo2(a:Integer; b:bar);
But how is it vice-versa? Can I assign a function-value to a Procedure? Example: 8<----------- (snip) ----------- Program TestIt; Type myfoo = Function(a:Integer):Integer; Var FooFunc : myfoo;
Procedure BarFunc(a:Integer); Begin Writeln('I am of bar with:', a) End;
Begin BarFunc(1); { Thank you Peter } FooFunc := myfoo(@BarFunc); Writeln('FooFunc(2) returns: ', FooFunc(2)); End. ----------- (snap) ----------->8 The resut is:
I am of bar with:1 I am of bar with:2 FooFunc(2) returns: 134641184
I would like to to set the value of FooFunc to 0.
(This is too needed as a parameter to a function expecting a fuctional-parameter but this function *must* be 0)
Eike