Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ains() bug
Message
De
30/01/2019 16:48:01
 
 
À
30/01/2019 15:14:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Divers
Thread ID:
01665830
Message ID:
01665837
Vues:
73
>>>This code
>>>
n=adir(a,"*.prg")
>>>DIMENSION a(n,6)
>>>ains(a, 2,2)
>>>LIST MEMORY like a
>>>doesn't work as expected, the array ends up a mess. Only the first row has a cell inserted at 2nd column, the rest not quite so. However, it works properly in Chen's VFPA. Can't find it documented on his documentation page, so reporting it here.
>>
>>Hi Dragan,
>>
>>It's not bug of AINS().
>>ADIR() return array with five columns.
>>DIMENSION a(n,6) destroy data in array.
>>
>>
>>MartinaJ
>
>... or more accurately, using DIMENSION to change the number of columns in a 2-dimensional array causes the data to be "rearranged" rather than add or delete a column. Obviously if you decrease the total number of elements in the array you lose the data at the "end" of the array.

Also, as recently discussed in another thread here, it's probably a bad idea to use "a" for the name of a variable (or array, probably doesn't make any difference) as it's a reserved "alias".

When testing or trying to repro bugs it's a good idea to avoid reserved words i.e. make sure that what you think is a bug (in VFP itself or code you're examining) exhibits the behaviour without using them. ISTR being bitten a couple of times over the years with this.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform