Structure variables

Discussion in 'Code Samples & Tips' started by Erel, May 19, 2007.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This example is also included in the desktop installation.
    The PieChart is an example of using the new structure variables to better organize the data.

    As the number of "slices" is not known, it is first declared with 0 items.
    Later, after reading the data file it is redeclared again as a two dimension array. The second dimension value is 5 as the number of fields in the structure.

    It is important to understand that structures are converted to arrays during compilation.
    A regular (not array) structure will be converted to a one dimension array and an array structure will be converted to an array with one more dimension.
    The last dimension length is always as the number of fields in the structure.
     

    Attached Files:

    • Pie.zip
      File size:
      1.5 KB
      Views:
      229
Loading...