If - else statement, Visual Basic Programming

A variation on the If...Then...Else statement lets you to choose from various alternatives. By adding up Else If clauses expands the functionality of the If...Then...Else statement so that you might control program flow depends on different possibilities. For instance:

Sub ReportValue(value) If value = 0 Then

MsgBox value

ElseIf value = 1 Then

MsgBox value

ElseIf value = 2 then

Msgbox value


Msgbox "Value out of range!" End If

You can add as several ElseIf clauses as you have to provide alternative choices. Extensive use of the ElseIf clauses frequently becomes cumbersome. A better way to select between numerous alternatives is the Select Case statement.

Posted Date: 4/18/2013 5:41:05 AM | Location : United States

Related Discussions:- If - else statement, Assignment Help, Ask Question on If - else statement, Get Answer, Expert's Help, If - else statement Discussions

Write discussion on If - else statement
Your posts are moderated
Related Questions
What are the differences between Property Get, Set and Let? Set - Value assigned to ActiveX Object from the form. Let - Value retried to ActiveX Object from the form. Get- Assigns

Use the While keyword to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following ChkFirstWhile instance

Hungarian Notation: The Hungarian Notation was invented by Charles Simonyi from Microsoft. It is a naming convention. It is a reminder of the type of a variable. The Handles h


Visual Basic 1. What is the method of creating a new project in VB.SSS 2. Illustrate Code Editor Window and Solution Explorer. 3. Write a VB program to sort and display a

Problem 1. Describe the importance and usage of .net framework in visual Studio 2. Write a program to sort and display an array of integers in ascending order using the conc

Mostly time, you just desire to assign a single value to a variable you have declared. A variable having a single value is a scalar variable. At other times, this is convenient to

Write Visual Basic programs for the following: 1.     Write a program that uses a "For Loop" to generate a list of temperature conversions in one degree increments from a given

PROGRAM TO ZOOM A RECTANGLE AS YOU DRAG 1. Generate a SDI application 2. Declare the 2 member variables clicked of Boolean type and m_ptoldpt of CPoint type. Use the class t