Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return .f. still allows exit from field. Why?
Message
From
27/08/1999 21:17:05
 
 
To
27/08/1999 07:33:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00258304
Message ID:
00258723
Views:
14
Harry,

You do NOT have a return statement for the second nested messagebox sequence, so the default of .T. will be used.

Cheers,

Jim N

>I use the following general form pretty widely:
>
>action=messagebox('Do you really mean this?',259,'Daft Entry in Field')
>if action <>6
> return .f.
>endif
>
>which works happily enough in most situations but I have just tested a new text box and found it refusing to work. It asks the question, accepts 'No' for an answer, returns .f. and then blithely allows the focus to move to the next field.
>
>here is the precise code:
>
>if not IgnorePaymentTomorrow
> if this.value=date()+1
> action=messagebox("You have entered Tomorrow's date - "+dtoc(thisform.paydate)+chr(13);
> +'Is this what you really meant?',259,'Payment Tomorrow!')
> if action<>6
> return .f.
> endif
>
> action=messagebox("Are you likely to enter further Payments (during this session) with Tomorrow's date?",259,'More Tomorrows?')
>
> if action=6
> ignorePaymentTomorrow=.t. && don't irritate the user if they've already told us they're entering more like this
> endif
> endif
>endif
>
>
>the debugger shows that answering No correctly make 'action' =7 and the code runs the 'return .f.' line and exits the valid but moves directly to the lostfocus rather than back to the setfocus.
>
>any ideas?
>
>
>
>Harry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform