2016 Mar 17 11:38 AM - edited 2016 Mar 17 12:38 PM
Based on its powerful facilities, I often use functions or procedures to solve some complex tasks and run them directly in DBISQL, without developping a particular front end. Often enough, I then use MESSAGE TYPE ACTION TO CLIENT to show a warning or error message, say, when input parameters are not reasonable or when no fitting data is found or whatever (with actual messages being more helpful, I guess...):
Now and then, it would be handy if I could ask the user to give an answer, as well, say whether the procedure should continue when something unexpected has been found, or to confirm the further execution. I'm thinking of a very simple yes/no choice similar to the WinAPI MessageBox() function, but more restricted, say an enhancement to the MESSAGE statement as the following non-existing (and probably poorly worded) QUESTION INTO clause:
MESSAGE expression [ TYPE { INFO | ACTION | WARNING | STATUS | QUESTION INTO myVariable} ] [ TO { CONSOLE | CLIENT [ FOR { CONNECTION conn-id-number [ IMMEDIATE ] | ALL } ] | [ EVENT | SYSTEM ] LOG } [ DEBUG ONLY ] ]
The message statement would then show a messagebox-style dialog with a yes/no button and would return the answer into the specified variable as 1 / 0 or whatever. I guess a binary choice would be sufficient, and it would not necessarily require a specification which answer is the default choice - you could simply adapt the message text accordingly.
I'm aware that one can partly avoid such questions by adding a further procedure parameter like "ResultOnError bit" but then a user would need to answer possible questions beforehand, which might be risky.
FWIW: I have not tried to use an external function to call the WinAPI MessageBox() function or the like because I suspect it would not show up on the client but on the server (or might be suppressed fully when running as a service?).
Request clarification before answering.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.