Is there a Solution for this problem?

J. Landman Gay jacque at hyperactivesw.com
Sun May 6 12:36:22 EDT 2007


Charles Szasz wrote:
> I have entry fields that the user fills in with numbers by using the 
> tab, return or enter keys. Each field is checked for a range of scores 
> by catching the exit or close field. If the user enters a number that is 
> above the range for the entry field, a dialog box appears warning them 
> of the mistake and puts the focus back on the field.  Here is my 
> question: I found that if the user uses the tab, return or enter keys to 
> enter the data with fields and then goes back using the cursor and 
> changes a data entry that is above above the range and instead of using 
> the above keys then uses the mouse to click a Calculate button which 
> computes the scores and goes to the next card, the error box does not 
> appear but I get an execution error  in the standalone. How do you trap 
> for this when the user does not use the tab, enter or return keys but 
> uses the mouse to move the cursor to click on the calculate button?

Due to the way Mac OS does focusing, an exitfield or closefield message 
is not always sent when the user clicks a button while a field is still 
selected. I had to work around this once by specifically sending a 
"closefield" message to the field before allowing the button script to 
execute. You could cycle through all your fields, checking their values, 
or you could do something like this:

   if the selectedfield is not empty then send "closefield" to the 
selectedfield

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list