Microsoft KB Archive/128737

= How to Declare Arrays on Forms Without Making Them Public =

Article ID: 128737

Article Last Modified on 2/12/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q128737



SUMMARY
In Visual FoxPro, you can declare an array on a form as a form property that can than be used to populate an object on the form rather than declaring the array as public. The example in this article illustrates this.



Step-by-Step Procedure
 In the Form Designer, choose the Form Menu pad, and select New Property.  In the Name editbox, type the array name. Include the declared size of the array in square brackets, as in this example: aMyarray[5]   In the Load Event snippet, populate the array: STORE "Hello" TO ThisForm.aMyarray  Add a combo or list box to the form. Be sure that the RowSourceType for that object is Array and the RowSource is thisform.aMyarray. Run the form, and observe that the object is populated with "Hello."

NOTE: Arrays that are form properties can be redimensioned at any time by using the usual techniques.

Additional query words: VFoxWin

Keywords: KB128737

-

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

© Microsoft Corporation. All rights reserved.