Instructions

Navigation:  Appendices > Macro Language >

Instructions

Previous pageReturn to chapter overviewNext page

In the previous sections we began our study of the Q++ Macro Language by looking at the types of data which can be used, then we saw how variables can be used to store this data (or values), and we then saw how operators and functions can be combined into expressions. We will now bring the above concepts together, to learn how to write instruction, code that actually does something.

 

Instructions are placed in the Instructions Block, where all the action happens. As its name suggests, the instructions block consists of a series of instructions. The specifics of how each line of code is written depends on the type of instruction, as we will see in the sections below. However, the following apply to any instruction line :

 

Individual symbols (litteral, variable, function, operator, function call) must be separated by at least one space.

Apart from the above minimum, Q++ takes no notice of the number of spaces. It will read 10 spaces as one space. Tabulations are treated as spaces.

An instruction can be split over multiple lines, using the symbol -> at the end of each line.

Each type of instruction has its own recommended style of indentation to ensure legibility. It is recommended that you follow it; it will make you code easier to follow and will highlight potential bugs.

 

In the next sections, we will cover the 4 basic types of instructions : Comments,

Assignment, Branches, and Loops.


Topic 108185 updated on 03-Jan-2002.
Topic URL: http://www.qppstudio.net/webhelp/index.html?theinstructionsblock.htm