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

Project on VB6.0, I need a VB6 software for making a soccerboard for 10 tea...

I need a VB6 software for making a soccerboard for 10 teams & automatically generate their fixtures

Associating images to toolbars - visual basic, Associating Images to Toolba...

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

Scope and lifetime of variables, The scope of a variable is finding out by ...

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

Three models for user interface design, THREE MODELS FOR USER INTERFACE DES...

THREE MODELS FOR USER INTERFACE DESIGN   The 3 models for the user interface design are the implementation model, mental model &the manifest model. The Implementation Mod

Application to count the number of possible triangles, A triangle is equila...

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be input

Context-sensitive help, CONTEXT-SENSITIVE HELP   The Context-sensitive...

CONTEXT-SENSITIVE HELP   The Context-sensitive help gives online help for the circumstances which is associated with that state. The Context-sensitive help can be implemented

Odbc, ODBC   The ODBC gives an API which distinguishes the data base v...

ODBC   The ODBC gives an API which distinguishes the data base vendors implementation via the ODBC drivers specific to a DBMS. The program will use the API to call the ODBC dr

The Generic Variable and Specific Variable, Explain difference, Generic Var...

Explain difference, Generic Variable: Create Object Ex:-Ole-Automation . No need refer the object library. What is Specific Variable: Binding Procedure Early & Late Binding ( Can

Looping, how to make logic of o program and how to use loop

how to make logic of o program and how to use loop

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