rhservan
asked on
Since I am no VBru will someone correct my syntax below? Part I
public function calvalue( vpi float, vcnet float, vtow float, type string) as string
IF vti <> NULL
then vti
else
IF vcnet <> NULL
then vcnet
else
vpow
end function
IF vti <> NULL
then vti
else
IF vcnet <> NULL
then vcnet
else
vpow
end function
ASKER
How would you test for NULL value?
I am looking for VB code that will test for NULL as in Coalesce. Is this possible?
I am looking for VB code that will test for NULL as in Coalesce. Is this possible?
What's a VBru?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What's a VBru
Valid question.
I'm assuming that since this question has been posted under the subject and topics related to Visual Basic, I'm assuming that this is either a question regarding VB6, VB Script, or Visual Basic dot Net.
Valid question.
I'm assuming that since this question has been posted under the subject and topics related to Visual Basic, I'm assuming that this is either a question regarding VB6, VB Script, or Visual Basic dot Net.
ASKER
A VBru is an individual established in VB coding as in a Visual Basic guru.(VBru)
Of which I am not.
I am using the Custom Code feature in SSRS 2008 which utilizes Visual Basic.
Of which I am not.
I am using the Custom Code feature in SSRS 2008 which utilizes Visual Basic.
Thank you for the clarification. I had not heard the term before, and couldn't decide if any answer was dependent on it. My conclusion is that this is not so, and anyway HooKooDooKu is obviously handling the question in an appropriately expert manner.
Here's a few things to point out.
Syntax of a VB If statement:
1. Single line If
IF condition THEN statement
2. Multi line If (with Else if and Else being optional)
IF condition THEN
statment
statment
ELSEIF condition THEN
statment
statment
ELSE
statment
statment
END IF
Additionally, for a VB function to return a value, you must set the value of the return value using the name of the function.
public function Max( v1 as float, v2 as float ) as float
IF v1 > v2 THEN
Max = v1
ELSE IF v2 > v1 THEN
Max = v2
ELSE
Max = v1
END IF
end function