Page 1 of 1

How to show interactively a question to the user

Posted: Wed Nov 26, 2014 11:26 am
by manumart1
Dialog.ShowMsg shows a message to the user on the log window and on the status bar; I have not been able to see a separate small dialog box with the message, even I closed the log window, but that is not my problem now.

My problem is:
I want to show a question to the user onto an small modal window or dialog box, so that he could answer Yes or No. Something like this:

Code: Select all

IF file exists THEN
  resp := Confirm("The file already exists. Do you want to ovewrite it?");
  IF resp = FALSE THEN
    RETURN
  END
END
I have not found a way to achieve this.

Thanks in advance

Re: How to show interactively a question to the user

Posted: Wed Nov 26, 2014 4:30 pm
by Ivan Denisov

Code: Select all

IF file exists THEN
  Dialog.GetOK("The file already exists. Do you want to ovewrite it?", "", "", "", {Dialog.yes, Dialog.no}, resp);
  IF resp # Dialog.yes THEN
    RETURN
  END
END

Re: How to show interactively a question to the user

Posted: Wed Nov 26, 2014 7:23 pm
by manumart1
Many many thanks, Ivan.

Also I see that to show an explicit message to the user, instead of Dialog.ShowMsg I must use:

Code: Select all

Dialog.GetOK("Operation correctly performed", "", "", "", {Dialog.ok}, resp)