hardrock95
asked on
vbscript test boolean variable that is function name
Below is my code, how do I test the function name for true or false? "If A = True" does not work. Many thanks for any help.
Function A
A=true
End Function
Function A
A=true
End Function
Ok, why are you testing the 'function name'? Shouldn't you passing a variable into a function to test?
ASKER
I inherited the code. Is that poor coding practice?
All the above does is assign true to A. Its basically a global constant. What is this used for?
ASKER
So, can it be tested for true or false?
From a different place, yes. Something like this:
If A = true Then
msgbox "Its True!"
Else
msgbox "Not working!"
End if
Function A
A=true
End Function
If A = true Then
msgbox "Its True!"
Else
msgbox "Not working!"
End if
Function A
A=true
End Function
ASKER
I tried that and it does not work. Please see original post.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That works for me also. Not sure what my issue was. I am going to close this and indicate you gave the answer.
Thanks a bunch.
Thanks a bunch.
ASKER
Solution by leonstryker