Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is error in script?
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,
i have one querry regarding script.
I was trying to parametrize the value from datatable, i wrote like this

Code:
Dim AgentName
AgentName=Datatable.value("AgentName")
Dialog("Login").Winedit("AgentName:").Set datatable("Agent",dtClobalsheet)

When i run the script it was picking the value from datatable and result window was also displaying the value which was taken from the datatable, while it should display some error. Because i wrote dtClobalsheet rather then dtGlobalsheet.
Even i did not wrote Option Explicit.
Can you let me know why it happened?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
hi rahul1234,
The 'SheetID' argument for DataTable.Value is optional and the values could be the sheetname, index or dtLocalSheet or dtGlobalSheet.
If you do not specify a value for this, the first sheet in the datatable is used i.e global sheet.

This will work for any value you specify like MySheet, dtdemoSheet etc. I think QTP treats this as a variable and it gets it as empty as not declared anywhere and uses the first sheet. this is why your script is working.
Use Option Explicit.

Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Saket,
Thanks for your reply. And it cleared my doubt.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  .vbs script error when trying to insert a value in a sapguitable frebuffi 5 6,858 07-18-2013, 03:04 PM
Last Post: Staff
  Error while creating object using description.create object in VB script SarodeGirish 5 6,269 06-19-2012, 05:30 PM
Last Post: ssvali
  Receiving an IIS authentication error when replaying a.net windows application script nithya.cov@gmail.com 0 2,551 04-16-2011, 10:58 AM
Last Post: nithya.cov@gmail.com
  error in datbase script sandeep.shivnani@gmail.com 0 2,256 03-08-2011, 06:03 PM
Last Post: sandeep.shivnani@gmail.com
  I couldn't rectify the error in following script..pls helpme frds.. Kishore_J 7 5,088 01-26-2011, 10:05 PM
Last Post: cdesserich

Forum Jump:


Users browsing this thread: 2 Guest(s)