Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing array to a form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00379967
Message ID:
00380012
Vues:
26
>>Hi Larry!
>>
>>>How are you determining that only the first element is being passed? Does ALEN() throw an error? What does TYPE("myArray[1]") return?
>>
>>I'm doing a DISPLAY MEMORY LIKE on the variable who receive the array in the INIT of the form. It show that the variable contain only the first value.
>>
>>I receive "C" from Type
>>
>>Thanks
>>
>>-Séb
>
>I just tested this and sure enough DISPLAY MEMO was wrong!! Well, not really. < s >
>
>The problem that I see is the way you are using DISPLAY MEMO. Because you are passing the array by reference, the only thing DISPLAY MEMO displays for that variable is a reference to the real array variable. It doesn't display all the elements for the varaible defined in the Init event.
>
>Rest assured that the variable is being passed by reference. Because Type("myarray[1]") returns something other than "U" proves the variable is an array. If you really want to check, add the following to your code:
>lparameters myarray
>activate screen
>for lxx = 1 to alen(myarray)
>   ? myarray(lxx)
>endfor
>This will display all the elements of your array.

Right, and also you can (what I usually do) SET STEP ON in Form.Init() and check the parameter in Watch or Locals window.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform