When you use the Option Explicit statement, you must explicitly declare all variables using the Dim, Private, Public, or ReDim statements.
If you attempt to use an undeclared variable name, an error occurs.
VB Script in general doesn't need variable declaration. Without using Dim, a variable can be directly used for assigning. For ex - temp=1
However, such practice can always be error prone. Ex: If i want to use the same variable in some other statement and miss spell it, say tempe=temp+1
VB Script still considers "tempe" as valid. In this case if we use Option Explicit on top of our script and proceed, then application will not proceed unless until u declare each and every variable.
Hence you make sure that your variable is serving your purpose.
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Saturday, May 31, 2008
Subscribe to:
Post Comments (Atom)
About Me
- RAJAPUTRA
- Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.
Subscribe to get updates on this blog
NOTE
Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.
No comments:
Post a Comment