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

Variable scope, Variables must always be described with the smallest scope ...

Variables must always be described with the smallest scope possible. VBScript variables can have the given scope. Scope Where Variable is Declared

Question, #question.algorithemtofindwhetheragivennumberisprime/not.

#question.algorithemtofindwhetheragivennumberisprime/not.

C#, I HAVE A C# ASSIGNMENT , WILL I FIND SOMEONE PROFESSIONAL HELP HERE ?

I HAVE A C# ASSIGNMENT , WILL I FIND SOMEONE PROFESSIONAL HELP HERE ?

Variant type - visual basic, Variant Type: If no data type is related ...

Variant Type: If no data type is related with the VB variables, it takes the default variant type. The variable x will be of the variant type when the two declarations below a

John Galt requests a program to double-check his Gas Bill, John''s gas supp...

John''s gas supply is read from a 4-digit meter each month that shows the current total gas used in cubic meters. The amount of gas used that month is determined by subtracting t

For next loop - vbscript, You can employ For...Next statements to run a blo...

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

Arrays, I need to design a logic for a program that allows a user to enter ...

I need to design a logic for a program that allows a user to enter 15 numbers, then displays each number and its difference from the numeric average of the numbers entered

Coding, Write an event procedure to automate the billing system of a superm...

Write an event procedure to automate the billing system of a supermarket. Give the details of database tables, forms, controls and menu design (if any). Make assumptions, wherever

Adding events in visual basic , Adding Events in VB   For adding the e...

Adding Events in VB   For adding the events in VB, first double click on the command button with the caption hello. The Private Sub command1_Click () and End Sub would be

The document - document view architecture, The Document: The document ...

The Document: The document contains the user's data. For illustration, after working on a text processor, the user may wish for to save the file. Such an action builds a docum

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