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

Statement in DM

Statements are the fundamental units of script execution in DM and C++. The statements within a script is evaluated in default order. In C++, the semicolon is a statement terminator. However, in DM scripts, a statement terminates simply by changing a line, namely DM recognizes the end of a line as a terminator, unless there is a backslash sign as discussed in the table below.

\ (backslash sign) Split long statement lines into multiple lines: the expression is continued on the next lines. Example

Some special, control flow statements are:
         i) if,
         ii) while,
         iii) for.

Other statements, such as block statement are used often as well. Variables declared within a block are local to that block.  They are not global to all statements in a script, that is, they are not globally accessible.