Practical Electron Microscopy and Database

An Online Book, Second Edition by Dr. Yougui Liao (2006)

Practical Electron Microscopy and Database - An Online Book

Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

Block Statement in DM

Because C++ is a structured and object-oriented language, DM supports the creation of blocks of code. A block is, in fact, a logically connected group of program statements that is treated as a unit. In C++ and thus DM, a code block is created by placing a sequence of statements between opening and closing curly braces {}.

In this case, the braces {} is used to group several statements and variable declarations into a compound statement or block. Such block is syntactically equivalent to a single statement. Variables declared within a block are local to the local statements.

Examples of blocks are:
        i) if block. (see page1150)
        ii) else block. (see page1150)