What is option base? diff between option baseand option explicit?pl explain

Questions by pghare

Showing Answers 1 - 2 of 2 Answers

deepali

  • May 22nd, 2006
 

option base

it is to declare the start of array. for eg. suppose an array is declsed with the dim statement. by default its start from 0 th index. using option base we can declare the start of an array from 1 ,2, or whatever.

option explicit

it forces you to declare a variable. suppose in an exampl, we have declared  a variable & trying to access the same variable with spelling mistake. if option explicit is there , then it gives error. if its not then the variable is considered as a new variable.

  Was this answer useful?  Yes

Ankur Jain

  • Aug 5th, 2006
 

Option Base -

When an array is declared by default starting index number is 0. By using this statement the programmer can change the starting index number. Well but according to coding conventions this concept should not be used.

Option Explicit -

Declaring a variable in Visual Basic by default is not must. Due to this by default every variable are considered as Variant hence unnecessart memory wastage. Well good practice is to declare variable of the type you want to use. Incase if you are not ware of the type u want to declare its better u declare explicity as variant. Well for this statment Option Explicit is used. this is set in top of General Declaration of Form Module. Once declared every variable type must be defined.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions