On 10 Jul 2008, at 23:50, Lourival Mendes wrote:

 var
//     my_proc : procedure;   // need to specify "local". impossible?
    my_proc : TProcedure;   // Lourival

 begin
    what_to_say := 'hello, world!';

    // Lourival Begin
    my_proc:= nil;

    if not Assigned(my_proc) then begin
       my_proc:= TProcedure(@proc_a);
       my_proc ();
    end

This will compile (because you are disabling the compiler's type checking), but is guaranteed to
a) not function correctly most of the time
b) crash in various situations


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to