Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00693166
Message ID:
00693168
Vues:
20
Joseph,

You can not pass an object property by reference.

You need to convert it to a local array, do the function and copy it back

local laCopy[1]
acopy( this.aTempArray, laCopy )
InsertArray(laCopy, 'Some Value' )
acopy( laCopy, this.aTempArray )

You can also just make this a function of the class and you won't have to copy the array back and forth.

>Everybody,
>If I have an array that is placed in a class property (This.aTempArray) how can I pass this array into a function that needs an array.
>
>For example, say I have a function that inserts an item into an array (See below), how do I pass (This.aTempArray) into the function.
>
>Example: InsertArrayItem(@This.aTempArray, 'Some Value')
>
>* Inserts an array element into an array.
>* For 1-D array
>* aArray - array name
>* sContents - contents to insert
>Function InsertArrayItem
>LPARAMETER aArray, sContents
>etc..
>endfunc
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform