Micro Focus QTP (UFT) Forums
On Error Resume Next - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: On Error Resume Next (/Thread-On-Error-Resume-Next)



On Error Resume Next - A.Saini - 10-01-2010

Hi,

I am calling an external action in two different scripts.Both scripts are using their seprate datatables.

In the external action at one point I am using a variable which value is coming from datatable.( Specific to Script)

So I have to use two different statement to get the value. Now while executing any of these script one statement will be corrent & one will be wrong. So I have to use "On Error Resume Next".

Code:
On Error  Resume Next  
                     intCheckType=     DataTable.Value("pCheckType","rSelectDrug [epCSubREFREQ]")
                     intCheckType=     DataTable.Value("pCheckType","rSel1Drug [epCSubREFREQ]")

I want to use "On Error Resume Next" only for these 2 lines not more than that.....

Please let me know how to do that.
Sad


RE: On Error Resume Next - balaji4u - 10-01-2010

Hi Ankur ,

Shall we change the design of your scirpt. In your main script define two different variables lets say database 1 and database 2 and in your external action check for the status of these two values or may be you can set a flag for any of these variables and let your external action query the specific database based on the flag value defined in the script.
So for script 1 database1 value will be true and for script 2 database2 value will be true and your external action will query those specific databases. I am not sure how flexible it can be in future to maintain it but just think of this soln.

Regards,
Balaji


RE: On Error Resume Next - A.Saini - 10-01-2010

Hi Balaji,

Thanks for reply...but it also has the same problem.As I have already explained that there are 2 scripts using common External Component(action),and each script has its specific database (Excel Sheet).

Code:
intCheckType=     DataTable.Value("pCheckType","rSelectDrug [epCSubREFREQ]")
intCheckType=     DataTable.Value("pCheckType","rSel1Drug [epCSubREFREQ]")

And this "CheckType" value is genrated & stored in the data table in the previous external action called by main script.

So there is no option to handle these variables into the main script.
SadSad


RE: On Error Resume Next - cdesserich - 10-02-2010

To turn error handling back off use:

Code:
On Error GoTo 0