Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Table From Array
Message
De
14/09/1999 09:43:25
 
 
À
14/09/1999 09:40:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00264400
Message ID:
00264418
Vues:
18
I would generally agree, Cetin. But, sometimes, you have to use things you don't like :-)

I am working on a 2.6 port to VFP where the original developer did "Stupid Array Tricks" all through the code. Not to say that Tom doesn't have a valid need for CREATE TABLE FROM ARRAY.


>John,
>You already managed it :) But IMHO for this type of settings :
>
>create table myTable (myField c(25), mySecondField i, my3rd d, my4th l ...)
>
>fits better (less coding + easy reading). AFIELDS() + create .. from array is good if you wanna use other properties of table (check array AFILEDS creates).
>Cetin
>
>>John:
>>
>>Silly me, I read the manual again. That always gets me into trouble! Here is the segment in help about this:
>>"FROM ARRAY ArrayName
>>Specifies the name of an existing array whose contents are the name, type, precision, and scale for each field in the table. The contents of the array can be defined with the AFIELDS( ) function."
>>
>>Thanks, your solution works fine.
>>Tom.
>>
>>
>>>It appears you have the length and precision mixed up. The first array element should be:
>>>
>>>x(1,1) = "MyField"
>>>x(1,2) = "C"
>>>x(1,3) = 25
>>>x(1,4) = 0
>>>
>>>
>>>
>>>>If I fill a 2 dimensional array (aFldNames) with the following:
>>>> String of field name
>>>> String 'C'
>>>> Number 0
>>>> Number 25
>>>>
>>>>and then issue the command
>>>>CREATE TABLE FREE FROM ARRAY aFldNames
>>>>
>>>>I get an error saying that the decimals or field length are invalid. I then tried to replace the numbers with character strings and get the same result.
>>>>
>>>>What is the proper way to do this?
>>>>
>>>>THANKS!
>>>>Tom.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform