Ian Branch 127 Posted February 23, 2022 Hi Team, Given the following TTable.EditError(DataSet:TDataSet; E: EDatabaseError; var Action: TDataAction); If I now feed the parameters to a second procedure via.. _EditError(Action, E, DataSet); Given that _EditError is defined as.. procedure _EditError(out Action: TDataAction; E: EDatabaseError; DataSet: TDataSet); And in _EditError, Action may be set to daRetry or daAbort.. Will the Action be passed back up to the TTable.EditError or do I need to make the 'out Action: TDataAction;' in the _EditError definition a var?? Regards & TIA, Ian Share this post Link to post
Guest Posted February 23, 2022 (edited) maybe help you OUT works like just a "container to changes on the variant", any value "IN it" will be discarded. any literal passed dont will be accepted Deeper( 'my value') == NOT! Deeper( myValuInAvar ) == YES! VAR works in 2 way (IN-OUT)! both works quickly equals... :() NOTE: MyVarREF == in fact, it's a "MyVarByVALUE" implementation {$R *.dfm} var MyVarIn: string; procedure Deeper(out MyOutVar: string); begin MyOutVar := random(1000).ToString; // Form1.Memo1.Lines.Add('MyOutVar: ' + integer(pointer(MyOutVar)).ToString + ' === ' + MyOutVar); // Form1.Memo1.Lines.Add('MyVarIn 4: ' + integer(pointer(MyVarIn)).ToString + ' === ' + MyVarIn); end; procedure NonSoDeeper(MyVarVALUE: string); begin Deeper(MyVarVALUE); // Form1.Memo1.Lines.Add('MyVarVALUE: ' + integer(pointer(MyVarRef)).ToString + ' === ' + MyVarVALUE); // Form1.Memo1.Lines.Add('MyVarIn 3: ' + integer(pointer(MyVarIn)).ToString + ' === ' + MyVarIn); end; procedure TForm1.Button1Click(Sender: TObject); begin MyVarIn := 'hello out-world'; // Form1.Memo1.Lines.Add('MyVarIn 1: ' + integer(pointer(MyVarIn)).ToString + ' === ' + MyVarIn); // NonSoDeeper(MyVarIn); // Form1.Memo1.Lines.Add('MyVarIn 2: ' + integer(pointer(MyVarIn)).ToString + ' === ' + MyVarIn); end; end. Edited February 23, 2022 by Guest Share this post Link to post