Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array gotcha - don't imagine a dimension
Message
From
17/12/2009 08:43:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Array gotcha - don't imagine a dimension
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01439557
Message ID:
01439557
Views:
171
Just run into a... I wouldn't even call it a bug, it's a gotcha.

I was messing with some code where I was supposed to have some two column array, but as it went I simplified it and the array came out single column, so it became one-dimensional. There were a few calls referring to the 1st column... but it always returns the first row.

Here's how to reproduce:
*-- TEXT BLOCK BEGIN
TEXT TO c NOSHOW TEXTMERGE
one
two
three
four
ENDTEXT
*-- TEXT BLOCK END
alines(aa, c)
for i=1 to 4
    ? aa(i), aa(i,1)
endfor
So just DON'T use the 2nd dimension in a single dimension array.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Next
Reply
Map
View

Click here to load this message in the networking platform