Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function Returning Boolean?

Tags:

function

vba

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.

like image 363
Mirial Avatar asked Jun 07 '11 12:06

Mirial


People also ask

Do functions always return boolean values?

It must be true but function returns false.

What is return boolean?

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.

Can a JavaScript function return a boolean?

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.


1 Answers

function MyFunction() as Boolean
    .....
    .....
    MyFunction = True 'worked
end function

dim a as boolean = MyFunction()
like image 147
Rene de la garza Avatar answered Sep 19 '22 15:09

Rene de la garza