Ian Branch 128 Posted September 20 Hi Team, D12.2. I am trying to get multiple inputs using InputQuery with the following code: procedure TForm12.Button1Click(Sender: TObject); var Values: array of string; begin SetLength(Values, 3); // Prepare for three input fields Values[0] := 'John'; // Default values Values[1] := '25'; Values[2] := 'London'; if InputQuery('User Information', ['Enter your name:', 'Enter your age:', 'Enter your city:'], Values, nil) then begin ShowMessage('Name: ' + Values[0] + sLineBreak + 'Age: ' + Values[1] + sLineBreak + 'City: ' + Values[2]); end; end; When run I getthe multiple inputs ok. Cancel works fine. If I click OK, I get an access violation. Is this a known issue? Does multi input work? Regards & TIA, Ian Share this post Link to post
pyscripter 689 Posted September 20 (edited) Use the overload without the last argument (which cannot be nil): if InputQuery('User Information', ['Enter your name:', 'Enter your age:', 'Enter your city:'], Values) then Edited September 20 by pyscripter Share this post Link to post
Ian Branch 128 Posted September 20 Ah Ha! Thank you. Much appreciated. Ian Share this post Link to post