Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Question
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00693166
Message ID:
00693168
Views:
19
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
Previous
Reply
Map
View

Click here to load this message in the networking platform