preprocessor
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
preprocessor [2018/02/13 17:03] – created wolfgangriedmann | preprocessor [2018/02/14 04:52] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== The Preprocessor ====== | ====== The Preprocessor ====== | ||
+ | |||
+ | The preprocessor is an unique feature of the X# compiler. In the Clipper times, the preprocessor was used to implement the commands (they were mapped to function calls), and in the VO times the preprocessor was present, but very few people used it. | ||
+ | |||
+ | The simpliest statement is the #ifdef, usable for conditional compilation, | ||
+ | < | ||
+ | super: | ||
+ | #else | ||
+ | super: | ||
+ | # | ||
+ | |||
+ | Now, in the X# compiler it is again a very powerful tool. It can be used to implement commands for compatibility with xBase languages like Clipper, FoxPro and Harbour: | ||
+ | < | ||
+ | [VIA < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ; | ||
+ | => DBUseArea(< | ||
+ | to be used like this: | ||
+ | < | ||
+ | Source: [[https:// | ||
+ | |||
+ | The development team has ported a Harbour app to X# using the preprocessor to translate the way @x,y SAY...GET | ||
+ | |||
+ | But it can also be used to write less code for MVVM ViewModels: | ||
+ | < | ||
+ | PROPERTY <n> AS <t>;; | ||
+ | GET;; | ||
+ | RETURN SELF:< | ||
+ | END GET;; | ||
+ | SET;; | ||
+ | IF SELF:< | ||
+ | SELF:< | ||
+ | SELF: | ||
+ | ENDIF;; | ||
+ | END SET;; | ||
+ | END PROPERTY </ | ||
+ | and to be used like this: | ||
+ | < | ||
+ | Source: [[https:// | ||
+ | |||
+ | You can find the full documentation here: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
preprocessor.txt · Last modified: 2018/02/14 04:52 by wolfgangriedmann