M Programming: A Comprehensive Guide

Chapter 8: Command Lines and Conditional Tests

Chapter 8: Command Lines and Conditional Tests
Note to Experienced Programmers
This chapter discusses the format of command lines, and it presents three forms of conditional tests ($SELECT, postconditional expressions with commands and arguments, and the IF and ELSE commands). The conditional tests warrant special study, since they differ in important respects from conventions in other languages. The remainder of the chapter material should be straightforward, requiring only a review of the Summary.
Chapter 7 introduced the concept of syntax in the form of single commands. In that chapter you learned how to write one M command properly, using variables and operators. At this point, your level of expertise has progressed to that of firstgrade texts, where each sentence begins on a new line.
In this chapter we extend the concept of commands to permit the inclusion of several commands on one line. We will also start to look at some commands that interact with others, thereby increasing our ability to form more expressive instructions, such as those which may or may not be executed.
Format of a command line
So far you have learned how to take the "nouns" and "verbs" of the M language and to construct statements with the vocabulary already introduced. Next, we will turn our attention to the creation of groups of statements (commands) that link together to perform useful functions.
The basic unit of an executable M program is a command line. This unit, in turn, is made up of the...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Microcontrollers (MCU)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.