Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I shortcut this code?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00316384
Message ID:
00316427
Vues:
17
>I have some fields in a table. I want to check this bunch of fields to see if they are all EMPTY(). What's the best way to do it? Maybe I need to use EMPTY() instead? But I was comparing one after another and it was not very efficient. Thanks in advance.
>
>IF INLIST(EMPTY(something here?),ADDLINE1,ADDLINE2,CITYADDR, ;
>STATEADDR,ZIP,HPHONE,WPHONE,WEXT,CPHONE,PAGER,FPHONE)
>...(condition if .T.)
>...
>ELSE
>...(condition if .F.)
>ENDIF

Are they all character data? If so:

IF LEN(ALLTRIM(AddLine1 + AddLine2 + ...)) = 0

Obviously, this tells you ony if all of them are empty, not which ones.

If this during data validation? You might be able to take advantage of GETFLDSTATE() instead. GETFLDSTATE(-1,cAlias) returns a string with a single character for each field in the record telling you if the field content was changed; the first position indicates the deletion status, and the remaining positions correspond to the fields in field number order.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform