ASP               DHTML               HTML               Javascript               Hourglass Web Design Hourglass Web Design


Basics

ASP signifiers <% and %>

Language Indicators (usually JavaScript or VBScript  <%@ Language="VBScript" %>

Forces all variables to be listed, put at the top of every page  <% Option Explicit %>

Dim Statement: stands for dimension, regards variables <% Dim VariableHere %>

Common Variable Types:

  • String: holds a string of alphanumeric characters (numbers, letters, and symbols). An example of this would be someone's name, address, or telephone number.
  • Integer: holds whole numbers. (e.g. 1, 2, 3, 4, etc.)
  • Decimal: holds numbers with a decimal point (e.g. 16.42, 6.92456, etc.)


How Variables Work: you can assign any name to a variable, however using a readily identifiable suffix can help, e.g., "strName" might be a string of names; "intNumber" might be a list of integers; "decNumber" might be a set of decimal numbers

IF/THEN: used to evaluate between two possible choices.

                IF strName = "N/A" THEN
                     strName = "Not Available"
                END IF
Types:

  • = Equal To: You can use this to compare any data type.
  • < Less than. You can use this to compare any numeric data type. (You can also use it for string variable types as well but you will probably find that you never need to except when comparing dates.)
  • <= Less than or equal to. You can use this to compare any numeric data type. (You can also use it for string variable types as well but you will probably find that you never need to except when comparing dates.)
  • > Greater than. You can use this to compare any numeric data type. (You can also use it for string variable types as well but you will probably find that you never need to except when comparing dates.)
  • >= Greater than or equal to. You can use this to compare any numeric data type. (You can also use it for string variable types as well but you will probably find that you never need to except when comparing dates.)
  • <> Not equal to. You can use this to compare any data type.

ELSE/IF: used to evaluate between more than two choices.

IF intScore > 90 THEN
      strGrade = "A"
  ELSEIF intScore > 80 THEN
      strGrade = "B"
  ELSEIF intScore > 70 THEN
      strGrade = "C"
  ELSEIF intScore > 60 THEN
      strGrade = "D"
  ELSE
      strGrade = "F"
END IF