Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_CUROBJ and valids
Message
From
10/04/1998 11:19:23
 
 
To
09/04/1998 16:13:43
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00090899
Message ID:
00091072
Views:
24
Joe

>
>@ 3,29 GET staff.number ;
> SIZE 1.000,13.167 ;
> VALID valstaf() error errmess
>
>READ valid valme()
>
>procedure valstaf
>ret = .t.
>getno = _CUROBJ
>if ";"$staff.number
> errmess="Person's # may not contain semi-colon(;)"
> ret = .f.
>endif
>return ret

Here, instead of returning 'ret' (which will either advance the cursor if .t., send it back to the 'offending' get field if .f.), issue a _curobj = objnum(fieldname) and then return. Your code would then look like:

procedure valstaf
if ";" $ staff.number
wait window "Person's # may not contain semi-colon (;)" timeout 2
_curobj = objnum(staff.number)
endif
show gets
return

Ditto on any other validations.

Because of running into problems like this from other people's code, I have studiously avoided using a 'return .f.' whenever possible.
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Reply
Map
View

Click here to load this message in the networking platform