Sambar Server Documentation

CScript #define


You can define constants of any type by using the #define directive. For example,
#define MAJOR_VERSION 5 #define MINOR_VERSION 0

would define MAJOR_VERSION and MINOR_VERSION to the values 5 and 0, respectively. CScript is case sensitive, it distinguishes between lowercase and uppercase letters in variable names. Traditionally, capital letters are used for defining global constants.

The above #define directive is functionally equivalent to:

const int MAJOR_VERSION 5; const int MINOR_VERSION 0;

In C, the #define statement results in a textual substitution at code compilation time, whereas the const variable is a typed variable. Since CScript performs dynamic type juggling, there is no distinction between these two constructs. But result in the creation of variables that cannot be modified by the program.

Macros

Presently macros are not supported. #define is limited to constants and/or expressions. © 2001 Sambar Technologies. All rights reserved. Terms of Use.