Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Conundrum
Message
From
11/04/2005 14:58:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Array Conundrum
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003455
Message ID:
01003455
Views:
64
I know I have probably done this before, but I cannot locate any similar code. I have an array like so:

myarray(1,1) ="Driver1 Violation1"
myarray(1,2) ="Driver1 Violation2"
myarray(1,3) ="Driver1 Violation3"
myarray(1,4) ="Driver1 Violation4"
myarray(1,5) ="Driver1 Violation5"
myarray(1,6) ="Driver1 Violation6"
myarray(1,7) ="Driver1 Violation7"
myarray(1,8) ="Driver1 Violation8"
myarray(1,9) ="Driver1 Violation9"
myarray(1,10)="Driver1 Violation10"
myarray(2,1) ="Driver2 Violation1"
myarray(2,2) ="Driver2 Violation2"
myarray(2,3) ="Driver2 Violation3"
myarray(2,4) ="Driver2 Violation4"
myarray(2,5) ="Driver2 Violation5"
myarray(2,6) ="Driver2 Violation6"
myarray(2,7) ="Driver2 Violation7"
myarray(2,8) ="Driver2 Violation8"
myarray(2,9) ="Driver2 Violation9"
myarray(2,10)="Driver2 Violation10"

I need to redimension this to 2,20 IF 1,11 -> 1,20 do not exist. The idea is to allow for 20 violations for Driver1, Driver2, etc (however many rows there are). I need to do this so it ends up like so:

myarray(1,1) ="Driver1 Violation1"
myarray(1,2) ="Driver1 Violation2"
myarray(1,3) ="Driver1 Violation3"
myarray(1,4) ="Driver1 Violation4"
myarray(1,5) ="Driver1 Violation5"
myarray(1,6) ="Driver1 Violation6"
myarray(1,7) ="Driver1 Violation7"
myarray(1,8) ="Driver1 Violation8"
myarray(1,9) ="Driver1 Violation9"
myarray(1,10)="Driver1 Violation10"
myarray(1,11) =""
myarray(1,12) =""
myarray(1,13) =""
myarray(1,14) =""
myarray(1,15) =""
myarray(1,16) =""
myarray(1,17) =""
myarray(1,18) =""
myarray(1,19) =""
myarray(1,20) =""
myarray(2,1) ="Driver2 Violation1"
myarray(2,2) ="Driver2 Violation2"
myarray(2,3) ="Driver2 Violation3"
myarray(2,4) ="Driver2 Violation4"
myarray(2,5) ="Driver2 Violation5"
myarray(2,6) ="Driver2 Violation6"
myarray(2,7) ="Driver2 Violation7"
myarray(2,8) ="Driver2 Violation8"
myarray(2,9) ="Driver2 Violation9"
myarray(2,10)="Driver2 Violation10"
myarray(2,11) =""
myarray(2,12) =""
myarray(2,13) =""
myarray(2,14) =""
myarray(2,15) =""
myarray(2,16) =""
myarray(2,17) =""
myarray(2,18) =""
myarray(2,19) =""
myarray(2,20) =""

There must be a simple way to check for the existance of myarray(1,11) without it returning .T. if the array is currently dimensioned myarray(2,10) and (2,1) exists? Then of course, once I can successfully determine that myarray(1,11)-myarray(1,20) do not exist, I need to redimension it without shifting the values to the wrong row and column. I am obviously forgetting something basic here but I cannot think what it is.

TIA,
Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform