Announcement

Collapse
No announcement yet.

Arrays with UDT's

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Arrays with UDT's

    // Woops, subject was meant to be 'Arrays within UDT's'

    I know it is possible to use arrays within User Defined Type's but I can't seem to do it without generating errors, I'm trying to do something like this:

    Type Name
    Field() as String
    FieldB() as String
    FieldID() as Integer
    End Type

    Hmmm any suggestions anyone?

    Matt


    ------------------


    [This message has been edited by Matt Grace (edited November 15, 2000).]

  • #2
    the Strings have to be fixed-dimension

    Code:
    #COMPILE EXE
    Type tName
    FieldA(5) as String * 50
    FieldB(5) as String * 50
    FieldID(5) as Integer
    End Type
    Global xName As tName
    
    FUNCTION PBMAIN() AS LONG
    xName.FieldA(0) = "my data"
    MSGBOX xName.FieldA(0)
    END FUNCTION

    ------------------
    -

    Comment


    • #3
      Thanks alot!!! :]

      ------------------

      Comment


      • #4
        Just for future reference: "arrays" within UDTs are NOT arrays; they are tables.

        None of the "ARRAY xxx" verbs work with them, and the current release of the compilers does not flag attempts to use those verbs on tables as errors.

        (Maybe the next release will).

        MCM
        Michael Mattias
        Tal Systems Inc. (retired)
        Racine WI USA
        [email protected]
        http://www.talsystems.com

        Comment

        Working...
        X