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

Else

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
i need your help in designing and coding a student record management system

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

PROJECT TO CREATE SPLITTER WINDOW   1. Generate the SDI application. 2. Enlarge the class tab page. 3. Select the view class. 4. On right clicking the menu pops up.

For naming anything variable names follow the standard rules in VBScript. A variable name: Should begin with an alphabetic character. Cannot have an embedded period. Sh

Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs The user types a letter into the textbox.   Functional Items 1. Read a

Illustration of GDI object CPen: 1. Generate a SDI application. And name it as gdipen. 2. Press ctrl (control key) and W altogether to invoke the class wizard. 3. Choose

Sets or returns context ID for topic in Help File. If Help file is indicated in the VBScript Err Object HelpFile Property, the HelpContext property is utilized to display automatic


#question.algorithemtofindwhetheragivennumberisprime/not.

Steps for Creating A MDI Form: 1. Build a new form and set IsMdiContainer property to true. 2. Build a child form class to add to the form. 3. Now Right click the proj