By using a macro which creates a scoped array in which to pass the data.
DataCall fun points( {"one",1,2,3},{"two",2,4,6} )
def DataCall
'%1 function name
'%2 variable type
'%3 data
scope
%2 d = { %3 }
%1 d, countof d
end scope
end def
include "$/inc/console.inc"
'indexbase 0
def DataCall
'%1 function name
'%2 variable type
'%3 data
scope
%2 d = { %3 }
%1 d, countof d
end scope
end def
type points
string name
double x,y,z
end type
function fun(Points*d, sys n)
for i=1 to n
printl d[i].name tab d[i].x tab d[i].y tab d[i].z
next
end function
'scope
'Points d= { {"one",1,2,3},{"two",2,4,6} } : fun d, countof d
'end scope
'using the macro:
DataCall fun points( {"one",1,2,3},{"two",2,4,6} )
waitkey