Just "return" the local udf value ($y) as a "return value" of the function, and assign it to another one declared local to you ($x), like this:

Code:

break on

dim $x

$x = myfunc()

?"x=" $x

exit 0

function myfunc()

dim $y

$y = 123

$myfunc = $y

endfunction



-Shawn