Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@ get xxxx valid

Status
Not open for further replies.

mallee

Programmer
Nov 7, 2000
116
Hello all,
I am still fighting this FPW 2.6a app in VFP6.
I have a program that works fine in fpw 2.6 but goes into a
loop on an @ get xxx va;id clause . The code simply does
a browse in a new window and returns .t. when the browse is
exited. something like :

def wind aaaa
acti wind aaaa
@ 2,2 get xyz valid _showfile()
read modal
xxxx
xxxx

procedure _showfile
def wind bbb
acti wind bbb
browse fields xxxxx,yyyy
deacti wind bbb
acti wind aaaa
return .t.

The program seems to be looping in the read clause, it
does not respond to the escape or enter keys, just loops
between the two screens.


Thanks for any help.
 
It might be the Modal statement. Since you are trying to open a second window in the Valid clause, and Modal restricts the user to the original window, this might be the cause of your grief. -----------------
Robert Bradley
use coupon code "TEKTIPS" for 15% off at:
 
The valid code is always going to call the validation function any time the control loses focus, and returning from the validation function and activating the first window effectively does a 'set focus' to the control, which will again want to call the validation function upon losing focus, .... well, you see where I'm going. You will get this difference in behavior with VFP.

Try adding something like:

procedure _showfile

IF !EMPTY(xyz)
RETURN .T.
ENDIF

def wind bbb
acti wind bbb
browse fields xxxxx,yyyy
deacti wind bbb
acti wind aaaa
return .t.

Dave S.
 
Thanks for the info, I will try you suggestions, BTW , I
forgot to tell you I had a _curobj = x after reactivating my
original window bt it too was ignored. Does vfp not
recognize the _curobj command ?
 
Same scenario. The valid method is still going to fire when it loses focus. VFP uses object.Activate or object.SetFocus or object.ActiveControl now. I think it ignores _CUROBJ.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top