Making decisions with select case, Visual Basic Programming

Assignment Help:

The Select Case structure provides an option to If...Then...Else If for selectively executing one block of statements from amongst multiple blocks of statements. Any Select Case statement gives capability similar to the If...Then...Else statement, however it makes code more efficient & readable.

A Select Case structure works along with a single test expression that is evaluated once, at the top of the structure. Then the result of the expression is compared with the values for each Case in the structure. If there is match, block of statements linked with that Case is executed:

Select Case Document.Form1.CardType.Options(SelectedIndex).Text

Case "MasterCard" Display MC Logo Validate MCA count

Case "Visa" Display Visa Logo Validate Visa Account

Case "American Express"

Display AMEXCO Logo

Validate AMEXCO Account

Case Else Display Unknown Image Prompt Again

End Select

Notice that the Select Case structure evaluates an expression once at the top of the structure. On the contrary, the If...Then...ElseIf structure can evaluate a distinct expression for each Else If statement. You can replace an If...Then...Else If structure along with a Select Case structure only if each Else If statement evaluates the same expression.


Related Discussions:- Making decisions with select case

Repeating a statement until a condition becomes true, You can employ until ...

You can employ until keyword in two ways to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following Chk

ADO.net architecture, write a detailed account on ADO.net architecture.

write a detailed account on ADO.net architecture.

Assigning values to variables, Assigning Values to Variables Values are...

Assigning Values to Variables Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression & the value you desire to a

Declaring variables in vbscript, You declare variables explicitly in script...

You declare variables explicitly in script via the Dim statement, the Public statement, & the Private statement. For illustration: Dim DegreesFahrenheit You declare multiple

Ddx - dialog data exchange, DDX - Dialog Data Exchange: The Data membe...

DDX - Dialog Data Exchange: The Data members can be related with specific controls in the dialog box. When the dialog box is displayed, the DDX will transfer the values into t

Homework Help, Creating an application that will calculate the cost of a ca...

Creating an application that will calculate the cost of a car rental based on the number of days that the car is rented. the cost of the car rental includes the cost of the car its

Lotto, You are asked to create the LOTO game customized according to the fo...

You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

Variable length strings, Variable Length Strings: The Strings can be de...

Variable Length Strings: The Strings can be declared using As or $ as shown in the code below; the msg and msg1 are the two strings and they are assigned the values using '='.

Genetics, GENETICS 1.         The branch genetics started in 1900 after...

GENETICS 1.         The branch genetics started in 1900 after rediscovery of Mendel's work. 2.         Gregor Johann Mendel is called Father of genetics. 3.         The t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd