Showing posts with label Variables. Show all posts
Showing posts with label Variables. Show all posts

Variables:

Variable: In programming language, variable is a value. In general variables are used to store any type of data or information. That Variable value can be change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that instructions will tell the computer what to do and what do not to do. The data consists of constants or fixed values that never change and variable values (which are usually initialized to "0" or some default value because the actual values will be supplied by a program's user). Usually, both constants and variables are defined as certain data types. Each data type prescribes and limits the form of the data. Examples of data types include: an integer expressed as a decimal number, or a string of text characters, usually limited in length.

Syntax: dim a= 10
   
        Here a= Variable name
                10=assigned value of the variable


Rules to be followed by giving variable name:
1)Start Variable name with alphabets.
                  Example:  dim a (Correct Method)
                                  Dim 1 (Wrong Method)
                                  Dim $ (Wrong Method)


2)  Don’t use any special character. Except underscore.
 Example:   dim a_ (Correct Method)
                      Dim a$ (Wrong Method)
                      Dim a$ (Wrong Method)
 

 

VB Script Initializations


VB Script Variables: Variable is nothing but we are allocating some space to the particular variable to store some information. In variables we are storing the information to that value.
A=10

Here A is Variable Name
 In VB Script we have two types of Variables.

1) User defined Variables
2) Pre-defined Variables.

Variables: 
For example:  a= 1o, dim =10
                       Here a=variable name
                                 10=we are assigning one value to the particular variable.

1) User defined Variables: In user defined variable user will define the variable name.
For example:  a= 1o
                       Here a=variable name
                                 10=we are assigning one value to the particular variable.
 2) Pre-defined Variable: pre-defined variable means Vb Script having default variables those variables are called Pre-defined.

For example:  dim= 1o
                       Here a=variable name
                       10=we are assigning one value to the particular variable.

In this example dim is a pre-defined variable. We can’t use that variable as a user defined variable.