How to Declare Arrays on Forms Without Making Them Public

Article translations Article translations
Article ID: 128737 - View products that this article applies to.
This article was previously published under Q128737
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page


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

  1. In the Form Designer, choose the Form Menu pad, and select New Property.
  2. In the Name editbox, type the array name. Include the declared size of the array in square brackets, as in this example:
  3. In the Load Event snippet, populate the array:
       STORE "Hello" TO ThisForm.aMyarray
  4. 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.
  5. 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.


Article ID: 128737 - Last Review: February 24, 2014 - Revision: 1.1
  • Microsoft Visual FoxPro 3.0 Standard Edition
kbnosurvey kbarchive KB128737

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from