yesno

Syntax

answer = yesno (window_title, message, yestxt, notxt)

Arguments

answer: integer

window_title, message, yestxt, notxt: text

Meaning

The user is presented a confirmation dialog and is asked to click either yestxt or notxt in a window. If the user clicks yestxt, answer will be TRUE, otherwise FALSE. The user has about nine seconds to choose between the Yes button and the No button. The seconds are counted down in the No button, indicating that if no choice is made, the result will be as if the user clicked the No button and the message will close by itself. Although Yes normally is the more likely answer, No would usually be the safest option because if this function appears in adapls, clicking the No button often means that the procedure or action won't be executed. So the default (after waiting nine seconds) is now the opposite of what it was*.

ACYesNoMessage

The confirmation message works in at least before-edit, after-field and before-storage adapls, but not in output format adapls. A complete list of supported adapl types is not available at this moment.

* In Collections versions older than 1.10, no confirmation dialog will be presented at all. yesno will just always return the value 1 (for Yes), assuming that that is the more likely choice. In existing adapls, yesno is mostly used to ask the user if some action must really be performed (maybe because the label of the checkbox starting the adapl is a little vague) or if an earlier created document must be overwritten, so the omission of a confirmation dialog in Collections may prove inconvenient at the most. However, in some cases it might be useful to reprogram the relevant adapl functionality: if the old functionality overwrote a previously created document only if the user confirmed the action, you could now choose to just overwrite the value in the field while creating a new document with a unique name (by adding the current date and time (without colons) to the file name, for example), so that the old document won't be overwritten. If the old functionality just asked for permission to run the adapl, you can leave the code as is (to keep it working in Adlib for Windows) and try to make the label on screen more descriptive.