define
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
define [2018/06/08 04:04] – created wolfgangriedmann | define [2019/08/21 06:02] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 11: | Line 11: | ||
< | < | ||
#define MyVulcanDefine 123 // Vulcan style, replaced by the compiler</ | #define MyVulcanDefine 123 // Vulcan style, replaced by the compiler</ | ||
+ | |||
+ | Please note that in the current X# version (2.0.4.0 aka Bandol GA) the # | ||
Why X# has been returned to the VO style has been explained by Robert v.d.Hulst: | Why X# has been returned to the VO style has been explained by Robert v.d.Hulst: | ||
- | For me the most important reason to switch back from #define to DEFINE is the way it was implemented and the consequences of this implementation. | + | //For me the most important reason to switch back from #define to DEFINE is the way it was implemented and the consequences of this implementation. |
- | In Vulcan the preprocessor (and the X# preprocessor | + | In Vulcan the preprocessor (and the X# preprocessor |
- | Consider the following code: | + | Consider the following code:// |
< | < | ||
Function Delete(nRec as LONG) AS LOGIC</ | Function Delete(nRec as LONG) AS LOGIC</ | ||
- | If the preprocessor compatibility command line option (/vo8) is switched on, then this will be preprocessor to: | + | //If the preprocessor compatibility command line option (/vo8) is switched on, then this will be preprocessor to:// |
< | < | ||
- | Please note how the name of the function was replaced by the value of the define. | + | //Please note how the name of the function was replaced by the value of the define. |
This causes many cryptic error messages, making it very difficult for new users to get started. | This causes many cryptic error messages, making it very difficult for new users to get started. | ||
- | Without /vo8 this would only happen if the function name was written in ALL CAPITAL letters. | + | Without /vo8 this would only happen if the function name was written in ALL CAPITAL letters.// |
- | The way VO does it (and the way the DEFINE In X# is implemented) this is not handled by te preprocessor. In a later compiler phase the " | + | //The way VO does it (and the way the DEFINE In X# is implemented) this is not handled by te preprocessor. In a later compiler phase the " |
The DEFINE itself is stored as a global const value inside the same class where GLOBALs and FUNCTIONs are stored. | The DEFINE itself is stored as a global const value inside the same class where GLOBALs and FUNCTIONs are stored. | ||
- | This does not have this side effect. | + | This does not have this side effect.// |
define.txt · Last modified: 2019/08/21 06:02 by wolfgangriedmann