Code: Select all
structure mystruct_t
b as byte
w as word
lw as longword
end structure
const setup_data() as mystruct_t =
(
(1, 1000, 10000), // first struct
(2, 2000, 20000), // second struct
(3, 3000, 30000) // third struct
)
The only method I could come up with to try and replicate this was to declare const arrays for each of the individual structure members, so the "structure array initialization" is spread over a few separate declarations...
Code: Select all
structure mystruct_t
b as byte
w as word
lw as longword
end structure
// const arrays for each of the individual structure members
const MAX_STRUCTURES = 3
const cs_member_b(MAX_STRUCTURES) as byte = (1, 2, 3) // init data for mystruct_t().b
const cs_member_w(MAX_STRUCTURES) as word = (1000, 2000, 3000) // init data for mystruct_t().w
const cs_member_lw(MAX_STRUCTURES) as longword = (10000, 20000, 30000) // init data for mystruct_t().lw
// example loop to get the values of each of the "const structures"
dim t as mystruct_t
dim i as byte
for i = 0 to (MAX_STRUCTURES-1)
t.b = cs_member_b(i)
t.w = cs_member_w(i)
t.lw = cs_member_lw(i)
next