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


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,190 12-19-2025, 12:51 PM
Last Post: Heimdall
  for performance, what's the best variable type to use for boolean _TRUE & _FALSE ? madscijr 12 1,229 09-29-2025, 02:59 PM
Last Post: dakra137
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 959 08-03-2025, 02:55 AM
Last Post: SMcNeill
Question Can a function return a custom TYPE? 12centuries 3 1,321 06-13-2024, 09:19 PM
Last Post: 12centuries
  DIM - AS - VARIABLE TYPE likely bug bartok 25 5,438 05-06-2024, 08:21 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)