|
Home > Archive > Getting Started with dBASE > August 2005 > dBase 2.5 Using Valid
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
dBase 2.5 Using Valid
|
|
| Norman Snowden 2005-08-20, 11:23 am |
| I can't seem to get Valid to work properly. Using the following:
function ENTRYFIELD2_valid
test = .T.
IF form.rowset.fields["pvap"].value <= 0
test = .F.
ENDIF
RETURN test
My valid message "Value must be greater than zero" comes on if a negative number is entered but the message continues to repeat even if a positive number is entered. The original negative number is retained and will not clear. This method worked fine with
my Visual dBase 5.7
How does Valid work with dBase 2.5 ?
| |
| Roger Sauer 2005-08-20, 8:23 pm |
| Norman, try testing the entryfield's value:
function ENTRYFIELD2_valid
test = .T.
IF this.value <= 0
test = .F.
ENDIF
RETURN test
or, more simply,
function ENTRYFIELD2_valid
return (this.value > 0)
Roger
Norman Snowden Wrote:
> I can't seem to get Valid to work properly. Using the following:
>
> function ENTRYFIELD2_valid
> test = .T.
> IF form.rowset.fields["pvap"].value <= 0
> test = .F.
> ENDIF
> RETURN test
>
> My valid message "Value must be greater than zero" comes on if a negative number is entered but the message continues to repeat even if a positive number is entered. The original negative number is retained and will not clear. This method worked fine wi
th my Visual dBase 5.7
>
> How does Valid work with dBase 2.5 ?
| |
| Norman Snowden 2005-08-21, 3:23 am |
| Roger Sauer Wrote:
> Norman, try testing the entryfield's value:
>
> function ENTRYFIELD2_valid
> test = .T.
> IF this.value <= 0
> test = .F.
> ENDIF
> RETURN test
>
> or, more simply,
>
> function ENTRYFIELD2_valid
> return (this.value > 0)
>
> Roger
>
> Norman Snowden Wrote:
>
with my Visual dBase 5.7[color=darkred]
>
Thank you Roger !
I finally found how to make my first code work by adding "Valid Reqired" and form.rowset.save() as follows:
function ENTRYFIELD2_valid
form.rowset.save()
test = true
IF form.rowset.fields["pvap"].value <= 0
test = .F.
ENDIF
Return test
However, your solution is shorter and eloquent. I will use it and I do appreciate your help.
Norman
|
|
|
|
|