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
Device Contexts: The Device Context (DC) is represented by the data type Handle to Device Context (HDC). The HDC is a handle to somewhat you can draw on; it can be the whole s

Software That Is Obscure: The Software hides the intensions, meaning and actions from the user. For illustration, if a user is asked whether a full installation, the custom in

Using Visual Studio 2010 C++ 1) Using Windows Explorer, make a copy of Irvine\examples\Project_sample folder in the folder where you keep your materials for this course.

This is a series of VBScript statements enclosed through the Function & End Function statements. A Function procedure is same to a Sub procedure, however can also return a value. T

Deleting Handlers With Class Wizard: The handler can be deleted by using the class wizard. The class wizard will delete the prototype and message map entry. The user should ma

flow chart symbols


MODELESS DIALOG The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of t

Displaying a file With Scrolling: To display a file with the scrolling option allows the steps as shown below: 1. Generate a SDI application. 2. In the Step 6 of the App

Variable Scope Prefixes As script size rise, so does the value of being capable to rapidly differentiate the scope of variables. A one-letter scope prefix preceding type prefix