I believe, it confused you because you should read the FoxPro help more carefully.
1. "... ALEN(ArrayName [, nArrayAttribute]) Returns Numeric
nArrayAttribute
Determines whether ALEN( ) returns the number of elements, rows or columns in the array according to the following values for nArrayAttribute:
0 Returns the number of elements in the array. Omitting nArrayAttribute is identical to specifying 0.
1 Returns the number of rows in the array.
2 Returns the number of columns in the array. If the array is a one-dimensional array, ALEN( ) returns 0 (no columns). "
2. to delete a row in array, you should use ADEL(ArrayName, nElementNumber) command.
3. What is wrong with Afields()? It creates a new array with information from the table on what you are sitting.
Also "a" trough "j" should not be used. Try /use a/ or /use j/ to see how foxpro behave.
>Hello!
>
>I have a Problem Programming a variable Array handling Program.
>Here is the Problem:
>
>Dimension a(2)
>a(1)="Hello"
>a(2)="I am Marvin"
>
>?a(1,1) -> Delivers "Hello"
>?a(2,1) -> Delivers "Hello" ... this really brings me to confusion
>
>?alen(a,1) -> delivers 1 ...WHY??? Why not 2
>
>So I work around my Problem with alen(a,2).
>Now I decide to let my Array be 2 Dimensional. Great so long...
>
>Dimension a(2,3)
>a(1,1)="Hello"
>a(1,2)="C"
>a(1,3)=1
>
>a(2,1)="I am Marvin"
>a(2,2)="A"
>a(2,3)=2
>
>?alen(a,2) -> delivers 3 ... which is not the Value I'd like to work with.
>So I use the :
>?alen(a,1) -> delivers 2 ... juhu
>
>This lets me decide to use the Multi Dimensional Array like this
>Dimension a(2,3)
>a(1,1)="Hello"
>a(2,1)="C"
>a(3,1)=1
>
>a(1,2)="I am Marvin"
>a(2,2)="A"
>a(3,2)=2
>
>But.. how do I delete a complete element...
>ok with adel(a,2,2)
>Now I'd like to have a look with the Debugger... no chance to get the correct Display.
>
>Why does the Afields(a) command show me the incorrect way?
>Many questions, but no solution. All I know is that this behaviour is more than confusing to me.
>Just wanted to let out my confusion.... *ggg*
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only