Warning: file(http://spyderp.in/softwareqatestings.com.txt) [function.file]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/content/41/5295441/html/SQT/includes/menu.php on line 89

Warning: Invalid argument supplied for foreach() in /home/content/41/5295441/html/SQT/includes/menu.php on line 89

Code is only executed when a condition (or conditions) evaluate to True

Provides a single application the ability to react differently to different input values

If
If condition Then
statement(s)
End If

Performs an operation only if the condition evaluates to True

Used when an action is either performed or not performed.

If Else

If condition Then
statement(s)
Else
statement(s)
End If

Performs the If portion only if the condition evaluates to True and the Else portion otherwise.

Used in an either or scenario when an operation is always performed.

If ElseIf

If condition1 Then
statement(s)
ElseIf condition2 Then
statement(s)
Else
statement(s)
End If

Only one section can be executed even if many conditions evaluate to True.

Used in a multiple choice scenario

Inclusion of the last Else is optional

Loops

Allows you to repeat running certain sections of your code

Code executes when a condition (or conditions) evaluate to True

Be careful with Loops. They can result in infinite processing.

Forms

Entry Condition

Entry only when a initial condition is met

Iterated

Repeats for a specific number of times

Loop Questions:

1.

Can this loop ever be entered
If no, then you dont need the loop
Can this loop ever be exited
If no, then you have an infinite loop

While
While condition
statement(s)
Wend

Entry Condition Loop

Simplest form of the loop

Requires manual modification of the loop condition

For
For variable = start To finish [Step change]
statement(s)
Next

Iterated Loop

Favored because all the loop details are in the definition statement

Examples:

Declaring Variables:

dim name
name=some value

Assigning Values to Variables

name="Hege"
i=200

If....Then.....Else

if i=10 Then
msgbox "Hello"
i = i+1
end If

if i=10 then
msgbox "Hello"
else
msgbox "Goodbye"
end If

if payment="Cash" then
msgbox "You are going to pay cash!"
elseif payment="Visa" then
msgbox "You are going to pay with visa."
elseif payment="AmEx" then
msgbox "You are going to pay with American Express."
else
msgbox "Unknown method of payment."
end If