Announcement

Collapse
No announcement yet.

Limitation with UDTs

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

  • Michael Mattias
    replied
    Weak syntax choice by the compiler publisher:

    "Arrays" within UDTs are not PowerBASIC "Arrays" in that none of the ARRAY functions (UBOUND, LBOUND, DIM/REDIM or ARRAY xxxxxx) work with them.

    I would have (and do) call "multiple indexed or subscripted occurrences of a UDT member variable" Tables.

    MCM

    Leave a comment:


  • Fred Harris
    replied
    I believe you are going to need to allocate your own memory with the Api allocation functions, and access the records with pointers.

    Added Later...

    If at all possible, I'd try to declare UDT variables of a fixed size, then dimension as many of these fixed size UDTs as you need.
    Last edited by Fred Harris; 13 Feb 2008, 01:37 PM.

    Leave a comment:


  • Adam J. Drake
    replied
    Dynamic portions of a UDT not possible, from the help file:

    subscripts The dimensions of a member array. Arrays of one and two dimensions are supported, but must be defined with constant or numeric literal values. That is, the total size of a UDT must be known at compile-time, so items like dynamic strings, which vary in size, cannot be part of a TYPE structure.

    Leave a comment:


  • norbert doerre
    started a topic Limitation with UDTs

    Limitation with UDTs

    PB has a known limitation with UDTs:

    Type TQuadix3D
    dp(0 To 3) As POINT3D
    End Type

    Type TQuadix3DArray
    Arr() As TQuadix3D 'needs here an integer dimensioning I try to avoid.
    End Type
    '
    '
    'Inside a function:
    Dim TQ3D(1 To 999) As TQuadix3DArray 'As an example for the wanted usage.

    In my current code I'm planning hundreds of similiar UDT definitions.
    How could I avoid dimensioning them like Arr(0) As TQuadix3D?
Working...
X