Jump to content
DelphiNoob

Getting user's input from input box

Recommended Posts

For some reason I can't get the input box to show on screen once the program is started.

This is basically my code: 

procedure TForm1.Form1Click(Sender: TObject);
var
  name : String;
begin
  name := InputBox('Name', 'what is your name?', '');
  ShowMessage(name);
end;

Am I missing something? Is there something I need to add onto uses or simply put, is this the complete incorrect syntax?

Any assistance is much appreciated. Thanks

Share this post


Link to post
Share on other sites

This is new for me. Looks like the InputBox is from DWS. When the code is compiled and run, you can see in the source that InputBox is called but absolutely nothing happens - not even an error.

Very weird.

Share this post


Link to post
Share on other sites
On 6/28/2019 at 10:02 AM, jarto said:

This is new for me. Looks like the InputBox is from DWS. When the code is compiled and run, you can see in the source that InputBox is called but absolutely nothing happens - not even an error.

Very weird.

Alright. Well then is there an alternative to get an input from the user?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×