Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing arrays within a class
Message
De
11/08/2000 12:58:19
 
 
À
11/08/2000 12:43:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00404012
Message ID:
00404023
Vues:
35
A class property (array or not) can only be passed by value to a function or a method. You can pass the name of the array to the method (this.DelimitedStringToArray(this.DelimitedString, ':', "this.ArrayProperty"))and use macro substition in the method to access the array or use a temporary array in the method and ACOPY() it to the array name passed as a parameter.

HTH
>I have a method inside a class that will convert a delimited string into an array. This method has three parameters in this order: tcString, tcDelimiter, tcArrayName
>
>I have also array properties inside the same class. However, I have an error when I passed the array property.
>
>Example:
>Init Method:
>this.ArrayProperty(1)=''
>this.DelimitedString ='String1:String2:String3'
>this.DelimitedStringToArray(this.DelimitedString,':',@this.ArrayProperty)
>
>The third line will cause an error THIS alias not found. I have resolved this by creating a local temporary array and pass this temporary array instead, then issue an ACOPY().
>
>Is this the case in VFP classes? or am I missing something here?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform