2005/5/10

     
 

CfgScript Basic Types

artefaktur

| Any Type | Basic Types | Object Types | Array Types | Enum Type | Props Type |

Basic types are the common atomar value types.


Content of this chapter:

   Basic Types
   Basic Types are Objects
   Literals



 Basic Types

BasicType
: 'bool'
| 'char'
| 'byte'
| 'short'
| 'int'
| 'jlong'
| 'float'
| 'double'
;

Sample:

// declaration and initialization of an int variable:
int i = 42;
bool b = true;


 Basic Types are Objects


Different to native C++-code the basic types are handled in CfgScript as objects too. ACDK uses the class  acdk::lang::dmi::DmiObject to manage basic types.


int i = 42;
i.toString().length() == 2;

Different to other Object types, basic types are passed by value, not by reference like normal objects.

 Literals

Literal of basic types can also be used as objects:

42.toString().length() == 2;
"AB".length() == 2;