quantzombie
Programmer
Hi All,
If I use nvl(var1,foo(xyz)) will the function foo executed everytime even if var is not NULL ?
If I use nvl(var1,foo(xyz)) will the function foo executed everytime even if var is not NULL ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
IF ISNULL(var1)
Foo(xyz)
ENDIF
IIF(ISNULL(var1), Foo(xyz), var1)
the function won't execute if the variable is NULL:
That should be: The functiion only executes, if the variable is NULL.
Function foo(xyz) will ONLY be executed if var1 = .NULL.
x = NULL
? NVL(x, Foo(x))
FUNCTION Foo
LPARAMETERS tlX
MESSAGEBOX("Hello World")
RETURN 2
and I could have made this more clear by adding: ...no matter what the value is.myself said:For example Nvl(value,MessageBox("test")) does show the message box.
Function myNVL(tTestForNull, tAlternativeValue)
If Isnull(tTestForNull)
Return tAlternativeValue
Else
Return tTestForNull
Endif
Endfunc
The real "miracle" is how IIF was done, not how NVL was not done
x = Func1() OR Func2()
x = Func1() AND Func2()