Discussion:
Get the return value of a function in action
Imran Khan
2018-08-06 03:39:10 UTC
Permalink
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.
--
--
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 ***@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Imran Khan
2018-08-06 09:07:27 UTC
Permalink
Hello All,

Please look into the matter and do the needful.

Thank you,
Imran.
Post by Imran Khan
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(strNoOfSe
rvices,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(strNoOfSe
rvices,contactNumber)", then i am getting "Type Mismatch" error.
Can anyone please help me out?.
Thanks in advance.
Thank you,
Imran.
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To unsubscribe from this group, send email to
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
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
m***@gmail.com
2018-08-06 14:36:13 UTC
Permalink
Remove call from

contactNumber = call fncActivateContract_CaptureContractNo()

There is a spelling mismatch in the function calls and body contract and contact
Post by Imran Khan
contactNumber = call fncActivateContract_CaptureContractNo()
--
--
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 ***@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Imran Khan
2018-08-09 02:49:05 UTC
Permalink
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?.
Post by m***@gmail.com
Remove call from
contactNumber = call fncActivateContract_CaptureContractNo()
There is a spelling mismatch in the function calls and body contract and contact
contactNumber = call fncActivateContract_CaptureContractNo()
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group, send email to
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
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
m***@gmail.com
2018-08-09 03:03:17 UTC
Permalink
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
Post by Imran Khan
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?.
Post by m***@gmail.com
Remove call from
contactNumber = call fncActivateContract_CaptureContractNo()
There is a spelling mismatch in the function calls and body contract and contact
Post by Imran Khan
contactNumber = call fncActivateContract_CaptureContractNo()
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group, send email to
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.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group, send email to
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.
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...