Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Conundrum
Message
From
12/04/2005 12:44:47
 
 
To
12/04/2005 09:31:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003455
Message ID:
01003842
Views:
27
This message has been marked as a message which has helped to the initial question of the thread.
Tracy, you can use this:
PUBLIC myarray
dimension myarray(8,30)
FOR k=1 TO ALEN(myarray,1)
 FOR j=1 TO ALEN(myarray,2)
    myarray[k,j]="Driver"+TRANSFORM(k)+" Violation"+TRANS(j)
 NEXT
NEXT

A_AddColumns(@m.myarray,10,"")
LIST MEMORY LIKE "myarray"

PROCEDURE A_AddColumns(aArray,columnsToAdd,fillValue)
PRIVATE old_ColumnCount , iRow, aBlank

old_ColumnCount = ALEN(aArray,2)

DIMENSION aArray(ALEN(aArray,1),m.old_ColumnCount+m.columnsToAdd),aBlank(m.columnsToAdd)
aBlank = m.fillValue
=ACOPY(aBlank,aArray,1,-1, 1 + ALEN(aArray) - m.columnsToAdd)
FOR iRow=ALEN(aArray,1)-1 TO 1 STEP -1
	=ACOPY(aArray,aArray,1 + m.iRow * m.old_ColumnCount ,m.old_ColumnCount,1 + m.iRow * ALEN(aArray,2));
	,ACOPY(aBlank,aArray,1,-1,1 + m.iRow * ALEN(aArray,2) - m.columnsToAdd)
NEXT

ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform