------------
From the help file:
"ByRef is better for passing huge objects like strings or big UDTs that should not be copied"
--------------
A warning is given (18) when passing "big" UDT's, it looks like "big" is when:
64 bit compiler, > 512 bytes
32 bit compiler, > 256 bytes
example
Code: Select all
#ifdef __FB_64BIT__
#define sz 513
#else
#define sz 257
#endif
type udt
as zstring * sz z
end type
function dothis(byval u as udt) as udt
print sizeof(u)
return u
end function
dim as udt u=("hello")
print dothis(u).z
sleep