OpenTP1 Version 7 Programming Reference C Language

[Contents][Index][Back][Next]

Constant declaration

Format

const  integer_type_spec  identifier=integer|value;
const  boolean  identifier=TRUE|FALSE|value;
const  char  identifier=character|value;
const  char*  identifier=string|value;
const  void*  identifier=NULL|value;

Meaning

The constant declaration declares a constant.

Specification item

The following integer constant data types can be declared:

identifier

Specify a constant name.

integer, character, string, and value

Specify values to be allocated to the constant. So long as it is predefined, any value can be specified for the value.

Explanation

  1. Do not specify hyper.
  2. Since the constant declaration is defined with #define in the stub, it is expanded if the constant is used in a UAP.

Example
const short TEN = 10;
const boolean FAUX = FALSE;
const char CHAR = 'A';
const char* DSCH = "abcde";

OpenTP1 IDL-only TxRPC restriction