Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use varible name add fields to a table?
Message
De
15/10/2002 01:14:02
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
14/10/2002 22:56:06
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, Chine
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00711196
Message ID:
00711210
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
Michale

> I have a table need to add fields to a exact number? How can I do it? The following code have error ,How to change it?

To add to Sergey's correct reply that fieldnames cannot begin with a number, here is a way to do this.
LOCAL lni, lcFld
CREATE TABLE Temp (Field1 N(8))
FOR lni = FCOUNT("TEMP") + 1 TO 38
	lcFld = "Field" + LTRIM(STR(lni,2))
	ALTER TABLE Temp ADD COLUMN &lcFld N(8)
NEXT lni
BROWSE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform