19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

114 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

where Case Else (<strong>and</strong> its action) is optional, <strong>and</strong> each value list contains one or more of the<br />

following types of items separated by commas:<br />

1. A constant<br />

2. A variable<br />

3. An expression<br />

4. An inequality sign preceded by Is <strong>and</strong> followed by a constant, variable, or<br />

expression<br />

5. A range expressed in the form a To b, where a <strong>and</strong> b are constants, variables, or<br />

expressions<br />

Different items appearing in the same list must be separated by commas. Each action consists<br />

of one or more statements. After the selector is evaluated, <strong>Visual</strong> <strong>Basic</strong> looks for the first<br />

value-list item containing the value of the selector <strong>and</strong> carries out its associated action. Figure<br />

4-3 contains the flowchart for a Select Case block. The pseudocode for a Select Case block is<br />

the same as for the equivalent If block.<br />

FIGURE 4-3 Flowchart for a Select Case Block

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!