- Local time
- Today, 17:08
- Joined
- Feb 19, 2013
- Messages
- 17,358
So do I. Both subs and functions can return multiple values when passed as byRef parameters (the default), but a function can also return a value - typically a boolean. For example can be used like thisI usually choose a function unless I'm really sure I just need a sub
if somefunction(a,b,c)=true then debug.print a, b, c
Code:
function somefunction(a as string, b as long, c as date) as boolean
somefunction=false
'do something to modify the values of a, b and c
'if all values modified OK then somefunction=true
end function
I've used something like this to optimise the size of a container (H/W/D) for a given volume to fit on a pallet.