Return -1 and return -2... what do they mean?

Started by stevengraff, January 21, 2014, 01:11:00 PM

Previous topic - Next topic

stevengraff

Normally, being a good code monkey, I use return -1 in my UDFs for dynamic dialogs, and that keeps the dialog from closing.

Recently, returrn -1 wouldn't work for me, so, wth, I tried return -2. Voila! it worked!

Why? How? I was just guessing! :)

I searched a little and poked around, but I was unable to stumble across much of a detailed explanation as to what these return codes are actually doing. Or, more precisely, what the dialog udf is doing with them!

Can you tell me please? Or is there some further doco that covers that?

Thanks.

Deana

The Dialog Callback procedure's return value has special meaning: 

Quote0 cancels dialog without updating control variables

-1 performs usual processing after return

-2 will not terminate. (Note: control variables will not get updated until the Dialog exits.) Use DialogControlGet and DialogControlSet, to get and set values.

n (positive integer) performs usual processing and exits the dialog and the number n is the return value of the Dialog statement as it exits.

This is documented under the Dialog function in the Windows Interface language help file [Windows Interface Language Reference > Things to Know > Dialogs > Dynamic Dialogs]
Deana F.
Technical Support
Wilson WindowWare Inc.