Srinivas,

very good explanation .. but what is difference passing values through
actions..
can you explain it.

thaks
koteshwar

On Fri, Jun 26, 2009 at 9:21 PM, Srinivas Pavuluru <[email protected]>wrote:

> Hi Abhijit
>
> You need to know what type of parameters you are passing and what are the
> validations you are going use.  Below example will give you clear picture.
> on the error what you are getting..
>
> Example 1:
>
> a = 20
> b = "30"
>
> msgbox xy (a,b)
>
> function xy (a,b)
> xy = a+b
> end function
>
> If  you execute above example you will get result as 50.  For the same
> function if you pass the value *a* as 20 or "20" and value *b* as "30" or
> 30 you will get result as 50.
>
> If you pass the values *a* as "20" and value *b* as "30" means both are
> strings variables. you will get the result as "2030" where as if you pass
> any one value as number you will get result as 50..
>
> But if you pass the value *a *as *20* and value* b* as *"30afdasdf"* and
> execute you will see *"Type Mismatch" error*.  You need to  know what
> values you are passing and how to use them in function.  Without knowing
> these basic things it is tough for you to do scripting.
>
> I hope you got the answer.. Enjoy scripting..
>
> Thanks
> Srinivas Pavuluru.
>
> On Fri, Jun 26, 2009 at 7:57 AM, Roman Zilber <[email protected]> wrote:
>
>> > "Type Mismatch" error.
>>
>> check if your functions return value, and the value in not None.
>>
>>
>> On Fri, Jun 26, 2009 at 1:41 AM, Abhijit Sahoo 
>> <[email protected]>wrote:
>>
>>> Thanks to all for replying to my problem........But the solution from
>>> Srinivas does not answer my question. i have tried both the ways..i.e.
>>> writing the function after and before the call, but every time its giving
>>> "Type Mismatch" error. i am trying to pass a string value as a parameter in
>>> the function call.
>>>
>>> Regards
>>> Abhijit
>>>
>>> On Fri, Jun 26, 2009 at 12:22 PM, Srinivas Pavuluru 
>>> <[email protected]>wrote:
>>>
>>>> Hi Abhijit
>>>> When you wrote a function with in an action, you need to call that
>>>> function for execution.
>>>> Don't right click before the calling function and execute them..
>>>> Function needs to be loaded in to the memory for execution.  If you wrote
>>>> the function before the call execution you will face this kind of issues.
>>>> Other way is copy entire function into one VBS file and enclose that file 
>>>> in
>>>> File --> Settings --> reference include that vbs file.. and call functions
>>>> in your action script.. Hope this will help.   If there is any other send
>>>> error message.
>>>>
>>>> Thanks
>>>> Srinivas Pavuluru
>>>>
>>>>
>>>>
>>>> On Thu, Jun 25, 2009 at 9:50 AM, Roman Zilber <[email protected]>wrote:
>>>>
>>>>> What did you do? which kind of error you got?
>>>>>
>>>>>
>>>>> On Thu, Jun 25, 2009 at 3:46 AM, Babloo <[email protected]>wrote:
>>>>>
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am newbie in QTP. I have some doubts in calling functions in action.
>>>>>> Following is the scenario.
>>>>>>
>>>>>> I have created a function inside an action and i want to use the same
>>>>>> function in the same action by calling the function and passing the
>>>>>> parameters. I have tried a lot but failed. Anyoe please help me on
>>>>>> this.
>>>>>>
>>>>>> Thanks
>>>>>> Abhijit
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards
>>>
>>> Abhijit
>>>
>>>
>>>
>>
>>
>>
>
>
> >
>


-- 
-----
regards,
kotes

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to