1 / 7

INT213-Week-2

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. Variables & Data Types.

nerice
Download Presentation

INT213-Week-2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 theDim 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=3.14159 %> • 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.

More Related