Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy to array
Message
De
09/10/2013 09:29:52
 
 
À
09/10/2013 02:39:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01585081
Message ID:
01585105
Vues:
67
>>Hi everybody,
>>
>>I have the following code
>>
>>
>> this.mysqlexec(m.lcSQL,'csrTables', program())
>>   this.addproperty('aTables[1]')
>>   dimension this.aTables[reccount('csrTables')]
>>   copy to array this.aTables fields table_name
>>   use in select('csrTables')
>>
>>I found that only the first row value is properly copied and the rest of the values remain false. Do you see a bug in this code? The csrTables has 13 rows and only the first row value is copied into that array.
>>
>>Thanks in advance.
>
>That's because your array has only one row

Actually, it was because her array had only one _column_. COPY TO ARRAY pays attention to whether the array is 1-d or 2-d.

Tamar

>
>Try
>
> dimension this.aTables[reccount('csrTables'), 1]
>copy to array this.aTables fields table_name
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform