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
The scope of a variable is finding out by where you declare it. While you declare a variable in a procedure, only code in that procedure can access or alter the value of that varia

A variable is convenient placeholder which refers to a computer memory location where you can store program information which may change when your script is running. For instance,

Event-Driven Programming: The Event-driven programming allows the program to react to various inputs or events.   The action on a graphical component is an event. For il

i want to use two forms in vb.net. when the progress bar in form1 reaches on a specific value then disable form1 and progress bar will stop and the second Form2 will popup which wi

SDK PROGRAMMING The SDK programming is a developing Win 32 based programs using the Win 32 API that directly interact with the hardware. Therefore the execution of the SDK prog

Write a program that permits the user to order a product from inventory. The user selects the product and enters the quantity. If there is sufficient quantity on hand of the produc

I have a tiff image of 25 pages. I capture particular square from particular page and past on one excel sheet one by one. it is possible, if yes how. Image have line no and pe

Assume you are creating an order entry and editing application for a book store. An order consists of a product, quantity, total price, payment type including Credit/Debit card acc

i have connected my visual basic 2010 express in ports and use it to send sms but it failed... now my teacher said that i have to use my LAN not port to send it instead..... please

MESSAGE LOOP   The message loop is the code in the Win 32 based application. It retrieves messages from the application's message queue and passes these to the related window