Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems re-dimensioning a 2 dimension array
Message
De
17/07/1998 11:08:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00118583
Message ID:
00118613
Vues:
16
>I have been trying to re-dimension a 2 dimensional array by adding 1 element to the 2nd dimension without any success. In the VFP documentation it claims that the additional element would be added and initialized to false instead, the current contents of my 2nd dimension simply get pushed up the ladder.
>
>Here is the code:
>
>*-- Open tastrade's customer table
>USE SYS(2004) + "SAMPLES\DATA\CUSTOMER" IN 0 ALIAS customer
>
>*-- Get an array of all fields in table
>m.lnFlds = AFIELDS( aFlds, "customer" )
>
>*-- Redimension the array so that we have an additional
>*-- element in the 2nd dimension
>LIST MEMO LIKE aFlds* TO PRINT NOCONSOLE
>
>DIMENSION aFlds[ m.lnFlds, ALEN( aFlds, 2 ) + 1 ]
>
>LIST MEMO LIKE aFlds* TO PRINT NOCONSOLE
>
>Thank you in advance.
Juan,
I don't know an easy way of doing it. For afields() you could try this one :
USE SYS(2004) + "SAMPLES\DATA\CUSTOMER" IN 0 ALIAS customer
cTempFile = "T"+sys(2015)+".tmp"
copy stru extented to (cTempFile)
use (cTempFile) excl
alter table (cTempFile) add column MyNewColumn L
select * from (cTempFile) into array aFlds
use in (cTempFile)
erase (cTempFile)
LIST MEMO LIKE aFlds* TO PRINT NOCONSOLE
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform