User Tools

Site Tools


preprocessor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
preprocessor [2018/02/13 20:06] wolfgangriedmannpreprocessor [2018/02/14 04:52] (current) wolfgangriedmann
Line 3: Line 3:
 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 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.
  
-Now, in the X# compiler it is again a very powerful tool. It can be used to implement commands for FoxPro compatibility:+The simpliest statement is the #ifdef, usable for conditional compilation, and very helpful in the migration from VO: 
 +<code>#ifdef __XSHARP__ 
 +  super:__FocusPage( int( nIndex ) ) 
 +#else  
 +  super:__FocusPage( nIndex ) 
 +#endif</code> 
 + 
 +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:
 <code>#command USE <db>     ; <code>#command USE <db>     ;
      [VIA <rdd>       ;      [VIA <rdd>       ;
Line 16: Line 23:
 <code>USE "C:\dbf\customer.dbf" VIA "DBFCDX" ALIAS test</code> <code>USE "C:\dbf\customer.dbf" VIA "DBFCDX" ALIAS test</code>
 Source: [[https://www.xsharp.info/forum/public-chit-chat/561-managed-dbf-using-x-language?start=12|https://www.xsharp.info/forum/public-chit-chat/561-managed-dbf-using-x-language?start=12]] - the second message by Chris Pyrgas Source: [[https://www.xsharp.info/forum/public-chit-chat/561-managed-dbf-using-x-language?start=12|https://www.xsharp.info/forum/public-chit-chat/561-managed-dbf-using-x-language?start=12]] - the second message by Chris Pyrgas
 +
 +The development team has ported a Harbour app to X# using the preprocessor to translate the way @x,y SAY...GET  commands to their own function calls, making it work without changing the original code.
  
 But it can also be used to write less code for MVVM ViewModels: But it can also be used to write less code for MVVM ViewModels:
preprocessor.txt · Last modified: 2018/02/14 04:52 by wolfgangriedmann