Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Compiled Code > Op-Codes

:pre-compiler,  :var,  :begin,  :end

Scroll Prev Up Next More

These op-codes are section headers which help make the compiled code easier to read. Technically the interpreter does not need them, although Q++Studio checks for their presence when opening a macro, to spot any corruption of the compiled code.

 

Consider the following simple "do-nothing" macro :

var
begin
end

The above macro will compile just fine to the following:

0000 :var
0001 :begin
0002 :end

A few point to note.

 

The source code pointer starts counting line numbers at 0, not 1.

The :pre-compiler header only appears if you include some compiler directives in your code.

The values of the system variables are initialized by the compiler, outside of the compiled code. The reason is that you do not know at compile time what these values will be, and some of these change all the time (such as n_TokenDate).

 

From the above Macro, the values for bRESULT and sRESULT, would be their default initial values: false and '' (empty string).

 


Topic 108284, last updated on 18-Apr-2020