Information générale
Titre:
VFP8, array access method returns error!!!
Is this a Bug or a Feature. In VFP6 and VFP7 runs !?!?
clear
lo = NEWOBJECT("test")
DIMENSION lo.arr(5)
FOR i=1 TO ALEN(lo.arr,1)
lo.arr(i) = NEWOBJECT("label")
endfor
SET STEP ON
* OK ?
FOR i=1 TO ALEN(lo.arr,1)
WITH lo.arr(i)
.caption = TRANSFORM(i)
endwith
endfor
* ERROR
FOR i=1 TO ALEN(lo.arr,1)
lo.arr(i).caption = TRANSFORM(i)
endfor
FOR i=1 TO ALEN(lo.arr,1)
? lo.arr(i).caption
endfor
DEFINE CLASS test as Custom
DIMENSION arr(1) = .f.
PROCEDURE arr_access
LPARAMETERS nIndex
RETURN this.arr(nIndex)
ENDPROC
enddefine
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement