Presentation is loading. Please wait.

Presentation is loading. Please wait.

INT213-Week-2 Working with Variables. What is variable

Similar presentations


Presentation on theme: "INT213-Week-2 Working with Variables. What is variable"— Presentation transcript:

1 INT213-Week-2 Working with Variables. What is variable
Types of variables used in ASP Naming convention of Variables Use of Const variable and Arrays Math and Comparison Operators, Concatenation. Finally, simple Exercise Practice.

2 Variables & Data Types There are many different types of data you might need to store into a variable: Number, string, dates and Times and so many more. A variable is an identifier what holds values in its own memory address. So a variable represents a storage place in the computer memory (RAM). That storage has to be given a name so it will be easy to call on that variable anywhere in the script. When you name a variable you dimension it. To dimension a variable use the Dim command. Ex: <% dim num %>

3 Variable Types Integer: Long and Byte Long can store larger number
Byte can store fewer number. Single for smaller fractional number Double for larger fractional number and require twice memory than single. Date it can hold either Date or Time. Boolean for True/False Currency Special data type that works with several special VBScript functions. VBScript use Variant variable.

4 Naming Variable in VBScript.
Do not use spaces, period, or dashes. Variable name must begin with a letter. Variable names should no longer than 255 characters. Do not use reserved word Do not reuse variable name.

5 Constant and Array A constant is like a variable, you can give it a name and store data into it. Ex:<% Const PI= %> Array is a data type, a sequence of variables with same name but holding different values.

6 Math & Comparison Operators
Addition, Subtraction, Multiplication and Division Integer Division EX: 5 \ 3 returns 1 Modulus Ex: 5 mod 3 returns 2

7 Simple Exercise focused on all topics.
Follow the lecture and instructions.


Download ppt "INT213-Week-2 Working with Variables. What is variable"

Similar presentations


Ads by Google