How to Declare an Array in FoxPro Programming

Written by bobson st. pierre
  • Share
  • Tweet
  • Share
  • Email

Visual FoxPro is an object-oriented and procedural programming language developed and deployed by Microsoft. Visual FoxPro is quick and simple to learn. The language syntax is quite similar to Visual Basic for Applications (VBA) and Visual Basic 6 (VB6), but with slight differences. One such difference is in the way arrays are declared. In VB, it's common to use the "Dim" statement to declare variables and arrays. However, in FoxPro, you must use "Dimension" to properly declare the array.

Skill level:
Moderately Easy


  1. 1

    Open Visual FoxPro. This will launch a white screen with the Command window open and ready for you to start writing your codes.

  2. 2

    Click inside the Command window to the right of the screen to get a cursor.

  3. 3

    Type the following in the Command window:

    Dimension la List[10] && Declares a one-dimensional array

    Declare laItems[5] && Also declares a one-dimensional array

    Public Array gaTable[10, 2] && Declares a public two-dimensional array

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.