Microsoft KB Archive/138659

= How to Pass an Array to a Form =

Article ID: 138659

Article Last Modified on 2/10/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q138659



SUMMARY
This article shows by example how to pass an array to a form.



Step-by-Step Example
  In the Command window, enter the following commands: DIMENSION array1(3) array1(1) = "One" array1(2) = "Two" array1(3) = "Three" MODIFY FORM passarray  &&& Create a new form  On the Form menu, click New Property, and name the property Array2(1).  In the form's Init event, place the following lines of code: PARAMETER Array1 DIMENSION This.Array2(ALEN(Array1)) =ACOPY(Array1, This.Array2) THISFORM.List1.NumberOfElements=ALEN(THISFORM.Array2) THISFORM.Refresh  Place a list box on the form, and set the following properties for the list box:

 Set the RowSource property to: THISFORM.Array2. Set he RowSourceType property to: 5-ARRAY.</ul> </li>  Save the form, and run it from the Command window with the following command line: DO FORM PASSARRAY WITH ARRAY1 </li> The elements from Array1 will be shown in the list box. Use the scroll bar if they are not all visible.</li></ol>

Additional query words: VFoxWin

Keywords: KB138659

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.