Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: InputQuery

This question is answered. Helpful answers available: 1. Correct answers available: 1.

Permlink Replies: 1 - Last Post: Feb 19, 2018 7:09 AM Last Post By: Robert Triest
Andrej Mrvar

Posts: 99
Registered: 10/20/10
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2018 5:56 AM
I have a simple question.
After using Input query and pressing OK, or something like this,
the InputQuery form closes.
Is it possible that the for still stays open,
in this way another Input can be provided.
Thanks in advance.
Robert Triest

Posts: 687
Registered: 3/24/05
Re: InputQuery
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2018 7:09 AM   in response to: Andrej Mrvar in response to: Andrej Mrvar
This is not so simple..

No, The InputQuery Dialog is a modal window and gives the input back when the user clicks OK.
After the OK the modal window closes and you can catch the value in your code.

You can try to loop and (re)display the Dialog

    if not inputquery('Test program', 'Please type your name', value) //Because the Dialog is executed as Modal your code stops/waits here..
    then ShowMessage('User cancelled the dialog');
  until value <> '';

If you want to catch more inputs from the dialog without closing it then you need to
create a dialog that is opened it with "Show" instead of "ShowModal"
But because your source will not stop/waiting for closing you need other techniques
to pass the input back to your main window. (like a callback function)
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02