>Hi
>
>2 questions really, based on the same problem.
>
>If I have array1(10) and array2(10, 2), is it possible to copy the contents of array1 into array2, but only into the 1st dimension, ie. 10, 1 but not 10, 2?
>
>Also, can you ASCAN say, array2 and only return the 1st dimension row, rather than the element?
>
>Thanks in advance
>Kev
Hi Kevin,
A foxpro array is allways one dimensional, it only appears as two dimensional. All operations like ACOPY, DIMENSION (try to change columns with DIMENSION) are bound first to the one dimensional array.
Question 1:
not with ACOPY but it's an easy:
FOR lnLoop=1 TO ALEN(Array2,1)
Array2(lnLoop,1) = Array1(lnLoop)
ENDFOR
Question2:
ASCAN gives you element number until you switch to version 7
if you use an earlier version
lnStart = 1
lnElement = ASCAN(latest,lvValue_ToAsk,lnStart)
DO WHILE !EMPTY(lnElement) AND ASUBSCRIPT(latest,lnElement,2)#lnSearchedCol
lnStart = lnElement+1
lnElement = ASCAN(latest,lvValue_ToAsk,lnStart)
ENDDO
IF !EMPTY(lnElement) THEN
lnRow = ASUBSCRIPT(latest,lnElement,1)
ELSE
lnRow = 0
ENDIF
ASCAN is a good reason to switch to VFP 7.0 ... ::)
HTH
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]