BRANCHING AND LOOPING in .NET

Print QR Code in .NET BRANCHING AND LOOPING

BRANCHING AND LOOPING
Read QR Code In .NET
Using Barcode Control SDK for .NET Control to generate, create, read, scan barcode image in Visual Studio .NET applications.
Generate QR Code 2d Barcode In .NET
Using Barcode printer for .NET framework Control to generate, create QR image in VS .NET applications.
[CHAP. 3
QR Code Scanner In .NET Framework
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
Encoding Barcode In .NET
Using Barcode creation for .NET framework Control to generate, create bar code image in VS .NET applications.
then be compared with the string values in the subsequent Case statements until a match is found. As before, Case Else provides a default in the event that a match cannot be found.
Bar Code Recognizer In VS .NET
Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET framework applications.
Quick Response Code Drawer In C#
Using Barcode drawer for .NET Control to generate, create QR image in .NET applications.
EXAMPLE 3.11
Generating QR In .NET
Using Barcode maker for ASP.NET Control to generate, create QR-Code image in ASP.NET applications.
QR Code Creation In VB.NET
Using Barcode printer for .NET Control to generate, create Denso QR Bar Code image in VS .NET applications.
The following program segment is similar to that shown in Example 3.10, except that the selection is based upon a string rather than the value of a numeric expression. The program segment assumes that a string has been assigned to Status. If the string is Single, Married or Retired (in either uppercase or lowercase), an appropriate value will be assigned to TaxRate. If any other string is entered, an error message will be displayed.
Painting Code 128 In .NET
Using Barcode maker for .NET framework Control to generate, create Code 128 image in .NET framework applications.
Making DataBar In .NET
Using Barcode drawer for .NET Control to generate, create GS1 DataBar Expanded image in VS .NET applications.
'Tax rate based upon marital status Dim Status As String, TaxRate as Single Status = UCase(Status) Select Case Status Case "SINGLE" TaxRate = 0.20 Case "MARRIED" TaxRate = 0.14 Case "RETIRED" TaxRate = 0.12 Case Else MsgBox("ERROR - Please try again") End Select
UPC-A Supplement 5 Drawer In .NET
Using Barcode generator for VS .NET Control to generate, create GS1 - 12 image in Visual Studio .NET applications.
ISBN - 10 Printer In .NET Framework
Using Barcode generator for .NET framework Control to generate, create Bookland EAN image in VS .NET applications.
Some additional options are available when writing Select Case statements. For example, if the value of the expression in the Select Case statement is numeric, then a numeric expression may appear in a succeeding Case statement. A logical expression may also appear, provided the expression is preceded by the keyword Is. Moreover, multiple values, separated by commas, may appear in a single Case statement. Also, a range of values, connected by the keyword To, may appear in a single Case statement. All of these options are illustrated in the following example.
Generate Data Matrix ECC200 In .NET
Using Barcode creation for Reporting Service Control to generate, create Data Matrix image in Reporting Service applications.
Printing DataMatrix In Objective-C
Using Barcode generator for iPad Control to generate, create Data Matrix 2d barcode image in iPad applications.
EXAMPLE 3.12
USS Code 128 Reader In C#
Using Barcode recognizer for .NET Control to read, scan read, scan image in .NET framework applications.
Paint Barcode In None
Using Barcode maker for Word Control to generate, create barcode image in Office Word applications.
The following program segment shows a selection based upon the value of a numeric constant.
Make European Article Number 13 In .NET
Using Barcode generation for ASP.NET Control to generate, create EAN-13 image in ASP.NET applications.
Create Code-39 In None
Using Barcode generation for Online Control to generate, create Code 39 image in Online applications.
Dim Flag As Integer, Label As String Select Case Flag Case 1, 3, 5 Label = "Odd digit between 1 and 5" Case 2, 4, 6 Label = "Even digit between 2 and 6" Case 7 To 9 Label = "Any digit between 7 and 9" Case Is >= 10 Label = "Too big" Case Else Label = "Nonpositive number" End Select
EAN 128 Creator In None
Using Barcode generator for Office Excel Control to generate, create UCC-128 image in Office Excel applications.
Printing Matrix 2D Barcode In VB.NET
Using Barcode creator for .NET framework Control to generate, create 2D Barcode image in Visual Studio .NET applications.
CHAP. 3]
BRANCHING AND LOOPING
The first two Case statements each contain multiple values separated by commas. The third Case statement contains a range of values connected by the keyword To (i.e., Case 7 To 9). And finally, the fourth Case statement contains a logical expression preceded by the keyword Is (i.e., Case Is >= 10).
Similar options are also available if the expression in the Select Case statement is a string. A succeeding Case statement may contain a logical expression, preceded by the keyword Is. A Case statement may also contain multiple strings, separated by commas. Or, a Case statement may contain a range of strings, connected by the keyword To. The following example illustrates these options.
EXAMPLE 3.13
The following program segment presents a selection based upon a single-character string.
Dim Char As String, Label As String Select Case Char Case "A" To "Z", "a" To "z" Label = "Character is a LETTER" Case "0" To "9" Label = "Character is a DIGIT" Case Is < " ", Is > "~" Label = "Character is NONPRINTING" Case Else Label = "Character is NOT ALPHANUMERIC" End Select
The first Case statement contains two string ranges. Each range includes the keyword To. The individual ranges are separated by a comma. The second Case statement includes a single range of strings. (Note that the digits 0 and 9 are written as strings, not numerical values.) Again, note the use of the keyword To. Finally, the third Case statement includes two logical expressions. Each logical expression is preceded by the keyword Is. The individual expressions are separated by a comma.
3.6 LOOPING WITH For-Next The For-Next structure is a block of statements that is used to carry out a looping operation; that is, to execute a sequence of statements some predetermined number of times. The structure begins with a For-To statement and ends with a Next statement. In between are the statements to be executed. In its simplest form, a For-Next structure is written as
Copyright © OnBarcode.com . All rights reserved.