Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing array to a form
Message
 
 
To
13/06/2000 15:52:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00379967
Message ID:
00380011
Views:
23
>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.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform