Joe,
Even though you change _CUROBJ variable in a valid, it does not change until you exit the valid. By setting it you are kind of asking to change objects, but the change doesn't happen till you exit this one. Meanwhile _CUROBJ tells you in which object you are _now_.
It is best to test for the error in the field valid. I always give the error message myself and return .T. and find it less complicated. If you have serveral fields it probably is good to test in the read valid as well. Naturally the read valid needs to return .F.
@ 3,29 GET staff.number ;
SIZE 1.000,13.167 ;
VALID valstaf() error errmess
READ valid valme()
PROCEDURE valstaf
IF ";" $ staff.number
WAIT WINDOW "Person's # may not contain semi-colon(;)"
_CUROBJ = OBJNUM(staff.number) && Or any other variable
* BY the way _CUROBJ = _CUROBJ forces it to stay, too, if you use it here
ENDIF
RETURN
Alex
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement