Index : Reference :

Data_Types

C.O.F.F.E.E. data types

Definition

typedef Data_Types
{
  float;
  int;
  bool;
  bytes;
  array;
  string;
  anytype;
  custom;
};

Members

float

The float type in C.O.F.F.E.E. is 32 bit and signed. The range is -3.4E38 to 3.4E38 with a precision of 7 digits.

Cast:
To cast a numeric variable to an float, use the float() function.

Note: See also int, typeof()

int

The int type in C.O.F.F.E.E. is 32 bit and signed. The range is -2,147,483,648 to 2,147,483,647.

Cast:
To cast a numeric variable to an int, use the int() function.

Note: See also float, typeof()

bool

Value is either TRUE or FALSE.

bytes

The byte array type in C.O.F.F.E.E. is an array of 8-bit bytes.

Cast:
Byte arrays can be defined with the new() function: var mem = new(bytes,16).

Usage:
The individual characters in a byte array can be accessed with the array operator, [].

Note: See also typeof(), mem2word(), mem2uword(), mem2iee(), mem2liee(), word2mem(), uword2mem(), long2mem(), iee2mem(), liee2mem()

array

The array type in C.O.F.F.E.E. can contain any kind of variable or object reference. Arrays can be one-, two- or three-dimensional.

Cast:
Arrays are created with the new() function: var arr = new(array,16). To create a two-dimensional array, use new(array,16,16).

Usage:
The individual characters in an array are accessed with the array operator, []. Remember that the first element is arr[0], so the nth element in arr is accessed with arr[n-1].

Note: See also typeof(), sizeof()

string

The string type in C.O.F.F.E.E. is an array of 16-bit Unicode characters.

Cast:
Strings can be defined by assigning text within quotes to a variable: str1 = "Hello World!", or with the new() function: var str2 = new(string,12). To create a string from another variable, use the tostring() function.

Usage:
The individual characters in a string can be accessed with the array operator, [].

Note: See also typeof(), stradd(), strins(), strmid(), strset(), strstr(), strchr(), strcmp(), tostring()

anytype

May be any of the above listed data types, or in many cases also structs and instanced class objects.

custom

Any type, including classes or structs that you have written yourself.


Copyright 2014 MAXON. See Plugin Cafe for the latest version. Last modified: 2014-10-03