the select case structure provides an option to


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.

Request for Solution File

Ask an Expert for Answer!!
Visual Basic Programming: the select case structure provides an option to
Reference No:- TGS0265894

Expected delivery within 24 Hours