helper macros
macro array size,type,[value] {
common local index
index = 0
if size
forward
type value
index = index + 1
common
repeat size-index
type
end repeat
end if }
array overload itself
macro arrayoverload [type] {
macro type definition& \{
match [size] values, definition: \\{
match vals:,values \\\{ array size,type,vals \\\}
match :,values \\\{ array size,type \\\}
overloaded equ \\}
match =overloaded,overloaded \\{type definition \\}
restore overloaded\}
struc type definition& \{
virtual
. type
end virtual
type definition \}}
test sequence:
include 'win32a.inc'
arrayoverload WNDCLASS,RECT ; overload only ones we need
WindowProc dd ?
_class dd ?
; now allowed both extended syntax and built in syntax
a RECT 1,2,4,6 ; built in syntax still work
b RECT[0] ; no occupy space just def struct
wc WNDCLASS[3] <0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class>
c RECT[3] <1,2,3,0>,<>,<1,2,3,0>
assert b.top=wc.lpfnWndProc