Posted: 3rd Oct 2022 10:14
One way in DBPro to return multiple values from a function.

+ Code Snippet
sync on : sync rate 30 : sync
type proto_t
	x as float
	y as float
	z as float
endtype

dim ary(0) as proto_t
ptr = get arrayptr(ary(0))

proto_func(ptr)
print ary(0).x;" , ";ary(0).y;" , ";ary(0).z

sync
wait key
end

function proto_func(aryptr)
	dim tmpary (0) as proto_t
	link array tmpary(0),aryptr
	tptr = get arrayptr(tmpary(0))
	tcnt=get arrayptr field count(tptr)
	for i = 1 to tcnt
		tfoff = get arrayptr field offset(tptr,i) 
		tiptr = get arrayptr item ptr(tptr,0)+tfoff
		poke float tiptr,rnd(10)*.75+rnd(5.254)*0.001
	next i	
	unlink array tmpary(0)
	undim tmpary(0)
endfunction