i'm trying to use one routine (centralControl) to process data from two different routines (inputThis and outputThat)... the one routine (centralControl) needs to call one of two other routines (doThis or doThat)... how? :(


procedure doThis;
begin
end;

procedure doThat;
begin
end;

procedure centralControl(var aValue : word; theRecord : somerec; var whichProc);
begin
  case aValue of
    0 : begin
          whichProc;   <<-- compiler says "illegal expression"
        end;
    1 : begin
          if theRecord^.aValue = something then
            whichProc;
        end;
end;

procedure inputThis;
begin
  centralControl(foo,thisRecord,@doThis);
end;

procedure outputThat;
begin
  centralControl(foo,thisRecord,@doThat);
end;



--
NOTE: No off-list assistance is given without prior approval.
      Please keep mailing list traffic on the list unless
      private contact is specifically requested and granted.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to