Thanks to you all for making it work..
On Fri, May 18, 2012 at 11:25 PM, Sulbha Pawde <[email protected]>wrote:
> Variant is the only data *type in VBScript. It *doesnt support declaring
> datatype of argument in function defination.
>
> datatype will be taken as a variant.
>
> Restating what suman and rajat said -
>
> Your code should be -
>
> Function ExtractNumber (UnformStr)
> Set RegEx = CreateObject("vbscript.regexp")
> RegEx.Pattern = "\d*\.\d*"
> If RegEx.Test(UnformStr) Then
> ExtractNumber = CDbl(RegEx.Execute(UnformStr) (0))
> Else
> ExtractNumber = vbNullString
> End If
> End Function
>
>
>
> On Fri, May 18, 2012 at 3:32 PM, kiran mahida09
> <[email protected]>wrote:
>
>> you cheq out i phone store
>>
>>
>>
>> On 17 May 2012 21:00, Sumanhyd <[email protected]> wrote:
>>
>>> I think you cant declare argument type in function definition. You can
>>> declare like byref,byval Unformstr
>>>
>>> Reagrds
>>> Suman
>>>
>>> Sent from my iPhone
>>>
>>> On 17-May-2012, at 20:24, Rajat Gulati <[email protected]> wrote:
>>>
>>>
>>> Try line 1 as Function ExtractNumber (UnformStr)
>>>
>>> RegEx.Execute would return a collection object, so handle it accordingly
>>> eg. :
>>>
>>> For each obj in CollectionObj
>>> ' Add your desired code
>>> Next
>>>
>>> On Thu, May 17, 2012 at 6:16 PM, Guruprasad R <[email protected]>wrote:
>>>
>>>> Hi,
>>>>
>>>> When i put the below function in QTP and save it as a VBS/QFL file, it
>>>> throws me an error:
>>>>
>>>> Line 1: Expected ')'
>>>> Line 9: Expected End of Statement
>>>>
>>>> Function ExtractNumber (String UnformStr)
>>>> Set RegEx = CreateObject("vbscript.regexp")
>>>> RegEx.Pattern = "\d*\.\d*"
>>>> If RegEx.Test(UnformStr) Then
>>>> ExtractNumber = CDbl(RegEx.Execute(UnformStr) (0))
>>>> Else
>>>> ExtractNumber = vbNullString
>>>> End If
>>>> End Function
>>>>
>>>> Can you pls help me on this error..
>>>>
>>>> Regards
>>>> Guru
>>>>
>>>> --
>>>> 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
>>>>
>>>
>>> --
>>> 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
>>>
>>> --
>>> 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
>>>
>>
>> --
>> 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
>>
>
> --
> 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
>
--
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