QB64 Phoenix Edition
QB64's TYPE / END TYPE inquiry - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: QB64's TYPE / END TYPE inquiry (/showthread.php?tid=2841)



QB64's TYPE / END TYPE inquiry - MystikShadows - 06-30-2024

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


RE: QB64's TYPE / END TYPE inquiry - luke - 06-30-2024

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.


RE: QB64's TYPE / END TYPE inquiry - MystikShadows - 06-30-2024

(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