>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