How to Declare an Array in FoxPro Programming


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.

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

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

  • Type the following in the Command window:

    Dimension laList[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

Related Searches


Promoted By Zergnet



Related Searches

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!