Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verify if a field already exists in a table
Message
 
À
06/07/2007 12:27:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01238247
Message ID:
01238393
Vues:
30
Another way to do it is using the Field function, which accepts a number as an index or a string as a name of the field, thus, for example
? Field(1, "Table") && "Name"
? Field("Name", "Table") && "Name"
? Field("FieldDoesNotExist", "Table") && ""

* So you can test the existence of a field with

if empty(Field("myTestField", "Table"))
	* Field "myTestField" does not exist in the table "Table"
endif
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform