a fuction is simply a block of code that accepts arguments, performs some action and returns a value to the calling code...
a typical function call:
myvariable=myfunction(arg1,arg2,...argN)
within a function you can use LOCAL variables that go out of scope when the function ends, and variables that are defined as GLOBAL in the top of your code.
(search the dbp help for uses and syntax)
Here is a function IanM wrote to replace dbp WrapValue function which breaks on values higher than 32000 or somewhere there-abouts
Function NewWrapValue(Source as float)
local Result as float
local Limiter as float
Limiter = int( Source / 360.0 )
Result = Source - (Limiter * 360.0)
if Result < 0.0 then inc Result, 360.0
Endfunction Result
If you wanted to use someother var in the function to help perform some action, aside from the LOCALS it needs to be dfined as a GLOBAL, but the return var and the calling var that is getting set does not need to be "global". It can be fltSomeVar as Float etc;
the call would look something like:
fltMyFloatVar=NewWrapValue(fltCurrentValue)
hope this helps...
-RUST-