Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP8, array access method returns error!!!
Message
De
02/04/2003 10:11:44
 
 
À
02/04/2003 09:41:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00772930
Message ID:
00772940
Vues:
21
This has been previously reported. Apparently it is a by-product of adding the collection object to VFP8. You can also do this as an alternative workaround:
FOR i=1 TO ALEN(lo.arr,1)
   laArray = lo.arr(i)
   laArray.caption = TRANSFORM(i)
endfor
>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
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform