Ask does not wait for an answer

simplsol at aol.com simplsol at aol.com
Wed Feb 8 00:22:11 EST 2006


Jim,
Thanks for the suggestion... but it did not work here (Orlando tonight).
Activating the Message Watcher slowed the process down enough to get a 
better look at what is happening:
I change a number in the field containing this script and press Enter.
The

 ask plainEnter a date for this shipment:2/7/6

string goes immediately to the "Ship Date 1" field.
Then the Ask dialog box appears on the screen!?!

If I enter some text in the dialog at this point and click "OK", that 
text will go into the "Ship Date 1" field as expected.

It is as if the script does not wait for a reply from the dialog?
Thank you, again - I had not thought of checking the script with the 
Messsage Watcher.
Paul Looney

-----Original Message-----
From: Jim Ault <JimAultWins at yahoo.com>
To: How to use Revolution <use-revolution at lists.runrev.com>
Sent: Tue, 07 Feb 2006 19:14:29 -0800
Subject: Re: Ask does not wait for an answer

    Just a quick guess... the Ask dialog is actually a Rev stack and you 
might
be getting a crazy 'closefield' message sent as the dialog is used, 
which
triggers another event loop.

I get pretty much the same thing, and don't have time tonight to check 
out
the details, however...

Do the following:
open the message watcher

mod your script to this
-------------------------
on closeField
  if fld "Ship Date 1" is empty
  then
    ask "Enter a date for this shipment:" with the short date
    if the result is "Cancel" then
      put empty into fld "Ship Date 1"
      select empty
      --exit closeField
    else
      put it into fld "Ship Date 1"
      select empty
    end if
  end if
  pass closeField
end closeField
------------------
Seems to work here.

Jim Ault
Las Vegas

On 2/7/06 5:48 PM, "simplsol at aol.com" <simplsol at aol.com> wrote:

> I hope there is a simple answer to this. I have the following code in 
a
> field:
>
>  on closeField
>  if fld "Ship Date 1" is empty
>  then
>  ask "Enter a date for this shipment:" with the short date
>  if the result is "Cancel" then exit closeField
>  put it into fld "Ship Date 1"
>  end if
>  end closeField
>
>  If I step through it in the debugger, it works as expected.
>   If I trigger it by closing the field, it will show the Ask dialog 
box,
> and, as it does so, it will put:
>
>  ask plainEnter a date for this shipment:2/7/6
>
>   into field "Ship Date 1" - without waiting for either the OK or 
Cancel
> buttons being clicked in the Ask dialog.
>   I have written this several different way (different if/then
> constructions, etc.) nothing seems to work, and I can't debug it
> because it works perfectly in the debugger.
>
>  I appreciate you help.
>  Paul Looney


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

    



More information about the use-livecode mailing list