Gentee Programming Language > Documentation > Syntax Download documentation

Macros

Macros of any fundamental type of the Gentee language are defined by using the define command. To perform macro substitution, you need to specify an expression name surrounded by the dollar signs '$'. If the macro is followed by the character which is unlikely to be used in the name, the final dollar sign '$' is considered to be optional. Actually, macros are not variables; instead, macros are replaced with their values during compilation.

define {
   a = "str"
   b = 10   
}
...
print( "\$a$ing \( $b + 20 )" )

There are the following predefined macros.
 
$_FILEThe full name of the current source file.
$_LINEThe current line of the source file.
$_DATEThe current date in the format DDMMYYYY.
$_TIMEThe current time in the format HHMMSS.
$_WINDOWSEquals 1 in Windows.
$_LINUXEquals 1 in Linux.

See also

    The define command


 Copyright © 2004-2006 Gentee Inc. All rights reserved.