Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64's TYPE / END TYPE inquiry
#1
Hi everyone,

Please move this thread where it belongs if not here. Smile

I just tried to declare a type end type structure but it does not work. here is the situation. I have this type

Code: (Select All)
TYPE FloorData
     FloorID AS LONG
     FloorDescription AS STRING * 60
END TYPE
       
TYPE BuilddingData
     Floors(9) AS FloorData   <- this line is red
END TYPE

It's telling me it needs element as tpy, element=list as type or end type.  I though using arrays was something that was always available to us. help please Smile
Reply
#2
QB64 doesn't support arrays in TYPEs. The usual options to fake it are either A) store an integer that references an index in a separate (usually global) 2D array, or B) serialise the content to a string with MKL$ and friends. Note that QB64 does allow strings of variable length in TYPE declarations.
Reply
#3
(06-30-2024, 01:53 PM)luke Wrote: QB64 doesn't support arrays in TYPEs. The usual options to fake it are either A) store an integer that references an index in a separate (usually global) 2D array, or B) serialise the content to a string with MKL$ and friends. Note that QB64 does allow strings of variable length in TYPE declarations.

Thanks luke now i know...could have swarn i've attemped this before.   but i guess not right? lol
Reply




Users browsing this thread: 1 Guest(s)