Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verfield()
Message
From
15/11/2000 11:52:31
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
14/11/2000 11:06:41
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00441618
Message ID:
00442179
Views:
9
AFAIK, EMPTY + ISNULL is only required when you're verifying the existence of an object reference, but EMPTY() will do to check for a value in a field.

For the second part of your question, you'd have to use buffering, from there you can revert automatically or let the user do it through a button in the form or toolbar; to do it automatically:
if !TableUpdate()
    
    TableRevert()

endif
But it's usually better to allow the user to correct the problem and try again or revert if he chooses so, rather than just dump all his work.

Then again it all depends on what you are trying to do, and if you're doing it in an interactive way or not.

P.S. Use the <PRE>, </PRE> on code to make it more readeable.

>VFP 6.0
>
>FUNCTION verfield
> DO CASE
> CASE ALLTRIM(UPPER(auth.authtype)) = "VISA"
> IF limit = 0 OR EMPTY(fund) OR EMPTY(account);
> OR ISNULL(fund) OR ISNULL(account)
> WAIT WINDOW "Can not allow that, fix it!"
> *Return .F.
> ENDIF
> ENDCASE
>ENDFUNC
>
>I am doing a "record validation" in the AUTH table to check the record instead of "field validation". Since the auth.authtype can be of different values, and different field requirements, I was told that this is the way to do it. Can you help me by adding suggestions or advise? The WAIT WINDOW is just for a test, I will have to do something that would cause the cursor to remain in that record if error (not allow to leave until corrected). Along with that, how can I make it so that is hitting the key, it would return it all back (or if it was a new record, it would just delete that record)? Do I need the EMPTY and ISNULL at the same time? This coding above is in the MODIFY DATABASE, "Edit Stored Procedures".
>
>Thank you.
>
>Chuck
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform