Yes, ASCAN help is a little bit confusing. Here's a sample code (VFP8 or later).
DECLARE myarray[3,2]
FOR i=1 TO ALEN(myarray,1)
myarray[i,1] = 10-i
myarray[i,2] = 10*i
ENDFOR
lnSite = 20
lnRow = ASCAN(myarray, lnSite, -1, -1, 2, 8)
IF lnRow > 0
? myarray[lnROw,1]
ENDIF
? myarray[2,2], myarray[4]
Yes, it's true that you can reference items in an 2-D array with 1-D notation but you should only do that if you have to.
>
>ASCAN(ArrayName, eExpression [, nStartElement [, nElementsSearched [, nSearchColumn [, nFlags ]]]])
>
>I am confused between elements and rows. When I use the ASCAN, it seems that nStartElement and nElementsSearched are really the row numbers and not element numbers.
>
>Also, the help for ASUBSCRIPT says "Each of these commands stores the character string INVOICE to the same array element:" Is this true? Isn't gaMyArray (4) the same as gaMyArray(2,2)?
>
>
>STORE 'INVOICE' TO gaMyArray(2, 1)
>STORE 'INVOICE' TO gaMyArray(4)
--sb--