I have simple function in VBA and I would need to check whether or not it has been successfully performed. I do not know VBA much, so I have no idea whether or not its possible. I want to do something like this: bool X=MyFunction()
.
I am using VBA in the QTP descriptive programming. This does not work:
Function A as Boolean
A=true
End Function
It says: Expected statement
But I cannot see any return type in my method etc.
It must be true but function returns false.
The boolean method returns true if it is even and false when it is odd. In the code above, the first step is to declare the boolean method and the return value expected. The boolean method returns a value that guides how the code login is implemented in the next method.
You can return a boolean value from a JavaScript function. Create a function and use the if statement to evaluate the given value to the function. And return true or false according to the conditions.
function MyFunction() as Boolean
.....
.....
MyFunction = True 'worked
end function
dim a as boolean = MyFunction()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With