@FProcedure := Pointer(strtoint(ListeFonction.Strings[SendIndex])); FProcedure;
unit OCC; interface type TOnboardComputerCar = class private fModelOCC : LongWord; public property ModelOCC : LongWord read fModelOCC write fModelOCC; end; var OnboardComputerCar : TOnboardComputerCar; implementation uses UPeugeot, URenault, UCitroen, UNissan, UMercedes, UBmw, UAudi; function TOnboardComputerCar.GetRPM: single; begin case fModelOCC of PEUG_MK300 : result := UPeugeot.MK300GetRPM; PEUG_ML600 : result := UPeugeot.ML600GetRPM; REUN_LV530 : result := UReunault.LV530GetRPM; CITR_CC4000: result := UCitroen.CC4000GetRPM; NISS_NS1SKL: result := UNissan.NS1SKLGetRPM; else result := 0.0; end; end; initialization OnboardComputerCar := TOnboardComputerCar.Create; finalization OnboardComputerCar.Free; end.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questioninterface type TToto = class public function ObjTest(AParam: integer): boolean; end; function GlobTest(AParam: integer): boolean; //Tu ne pourra pas utiliser ces 2 fonctions avec un même type de variable type TGlobFunc = function(AParam: integer): boolean; //pour les fonctions globales TObjFunc = function(AParam: integer): boolean of object;//pour les fonctions d'objets ... var objFunc: TObjFunc; globFunc: TGlobFunc; begin objFunc := @MyToto.ObjTest; //ok objFunc := @GlobTest; //pas ok globFunc := @MyToto.ObjTest; //pas ok globFunc := @GlobTest; //ok