Get the return value of a function in action

22 views
Skip to first unread message

Imran Khan

unread,
Aug 5, 2018, 11:51:28 PM8/5/18
to QTP - HP Quick Test Professional - Automated Software Testing
Hello,

I have a function which should return a value and i have to get the returned value from the above function and i have to pass the value to another function. 
PFB the sample code skeleton,

1. Public Function fncActivateContract_CaptureContractNo()
                   ' Few code here
    End Function


2. Public Function fnc_T1_ContingentValidation(strNoOfServices,contractNumber)
                   ' Few code here
    End Function


Below is the action,

Dim contactNumber

 contactNumber = call fncActivateContract_CaptureContractNo()
 Call fnc_T1_ContingentValidation(strNoOfServices,contactNumber)

Here i am getting two errors.

1. If the control comes here "contactNumber = call fncActivateContract_CaptureContractNo()", then i am getting "Syntax error".
2. If the control comes here "Call fnc_T1_ContingentValidation(strNoOfServices,contactNumber)", then i am getting "Type Mismatch" error.

Can anyone please help me out?.

Thanks in advance.

Thank you,
Imran.

Imran Khan

unread,
Aug 6, 2018, 10:32:56 AM8/6/18
to mercu...@googlegroups.com
Hello All,

Please look into the matter and do the needful.

Thank you,
Imran.

--
--
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 Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+unsubscribe@googlegroups.com
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 Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mgkg...@gmail.com

unread,
Aug 6, 2018, 10:36:22 AM8/6/18
to mercu...@googlegroups.com
Remove call from 

contactNumber = call fncActivateContract_CaptureContractNo()

There is a spelling mismatch in the function calls and body contract and contact

On Aug 6, 2018, at 2:37 PM, Imran Khan <itsmei...@gmail.com> wrote:

contactNumber = call fncActivateContract_CaptureContractNo()

Imran Khan

unread,
Aug 8, 2018, 11:00:12 PM8/8/18
to mercu...@googlegroups.com
Thanks Ganesh. I have removed the "Call" and it works fine.

But, the second one i am unable to understand. Do we need to use the same spelling for both arguments and parameters?.

--

mgkg...@gmail.com

unread,
Aug 8, 2018, 11:03:26 PM8/8/18
to mercu...@googlegroups.com
You can use different variable names but here without having a look at the function body I cannot say why you are getting error.

So suggesting same variable names for now and anyways if the first function is working fine it will give variable the value for the second function 

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 Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages