CALL SomeFunction(new int{0, 1, 2, 3, 4})
'PASSING ANONYMOUS ARRAYS
function f(int *a,n)
print n
int i
for i=1 to n
a[i]*=2
next
end function
f( int{1,2,3,4,5}, countof )
uses console
type RECT
long left
long top
long right
long bottom
end type
function f(sys *prc) as *sys 'RECT ptr
RECT *rc : &rc=&prc
printl "in function f: " rc.left ", " rc.top ", "rc.right ", "rc.bottom
return &rc
end function
RECT ptRect1 = {10,15,100,200}
RECT *ptRect2
&ptRect2 = f(&ptRect1)
printl "ptRect = " ptRect2.left ", " ptRect2.top ", "ptRect2.right ", "ptRect2.bottom
printl "Enter: " : waitkey
but perhaps there is a better way to do this?
uses console
type rect
long left
long top
long right
long bottom
end type
function f(rect*rc) as rect*
'rect rc at prc
printl "in function f: " rc.left ", " rc.top ", "rc.right ", "rc.bottom
return &rc
end function
RECT Rect1 = {10,15,100,200}
RECT *ptRect2
&ptRect2 = f(Rect1)
&ptRect2 = f(rect{10,15,100,200}) 'anon rect
printl "ptRect = " ptRect2.left ", " ptRect2.top ", "ptRect2.right ", "ptRect2.bottom
printl "Enter: " : waitkey