Skip to main content
September 3, 2006
Question

Mixing Arrays and Structures

  • September 3, 2006
  • 1 reply
  • 254 views
I may be mistaken, but currently I can only make arrays work when assigned to discrete numbers (e.g. 1,2,3) and structures only with a defined label (e.g. key1, key2, key3).

If this assessment is correct I would like to make an “array” of “structures” which I can’t seem to get right either.

Here is my point/objective – to have a list of items that basically then would have descriptors. Ergo, I could loop though the list using discrete numbers but then finally on the final “level” I can use meaningful labels.

Example:

List.1.Title
List.1.Size
List.1.Other
List.2.Title
List.2.Size
List.2.Other

Maybe this isn't possible, but is there a viable alternative?
    This topic has been closed for replies.

    1 reply

    Inspiring
    September 4, 2006
    quote:

    Originally posted by: Riluve
    I may be mistaken, but currently I can only make arrays work when assigned to discrete numbers (e.g. 1,2,3) and structures only with a defined label (e.g. key1, key2, key3).
    If this assessment is correct I would like to make an “array” of “structures” which I can’t seem to get right either.
    Here is my point/objective – to have a list of items that basically then would have descriptors. Ergo, I could loop though the list using discrete numbers but then finally on the final “level” I can use meaningful labels.
    Example:
    List.1.Title
    List.1.Size
    List.1.Other
    List.2.Title
    List.2.Size
    List.2.Other
    Maybe this isn't possible, but is there a viable alternative?

    List=arraynew();
    list[1]=structnew();
    etc

    By the way, naming an array "list" could confuse some people, me for example.