indeed I forgot that setting of $iif2.

but don't understand what you are wondering about vartypes.
iif2 does not care about them.

don't know what you mean with scope either, as what you put into arg, has the scope of the udf.
so, can't see a problem there.
{edit}
mm...
now I think I got what you ment.
anyway, see my end comment as it says it really clearly [Wink]
this was just kinda pseudo-presentation that it can be done [Razz]
{/edit}

and as final, I didn't mean this as solution.
no, I just wanted to show how easy it would actually be to re-design the iif of kix and make it actually usefull.
_________________________
!

download KiXnet