Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

When and why do you use "OPTION EXPLICIT" in VB Script.
Is there any online help or something to learn the script
for Beginners?

Answer Posted / pallavi nandula

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.

VBScript ingeneral doesn't need variable declaration. For
example without using "Dim" a variable can be directly used
for assigning etc. For ex: temp=1

However, such practise can always be error prone. Ex: if i
want to use the same variable in someother statement and
miss spell it,say

tempe=temp+1

VBScript still considers "tempe" as valid. This case if we
use OPTION EXPLICIT On top of our application and proceed
then application will not proceed unless until u declare
each and every variable. Hence u make sure that ur variable
is serving ur purpose.

in this example u recognize that "tempe" is not desired.
Hope this clarifies.

Is This Answer Correct ?    88 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

assume i have few url link how will i dynamically call then using descriptive programming?

2072


How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.

1974


what is the hierarchy to use properties in descriptive programming

2039


How many types of recording modes in the qtp?

1143


wht type of User defined functions or Java Releated functions do we write in VB scripting

2287


Discuss quicktest professional (qtp) environment?

1060


supose i hv to acsess some functionlaties of a test in 1 machin , some part other machin how can acsess?

1862


hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company

1953


What are the recording modes in wave event?

2061


Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1870


What is debugging? How you debug your script?

1241


1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?

2014


How to creating an output value using quicktest professional (qtp)?

1061


Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?

1949


What is the difference between qtp and selenium?

1087