type: int
[contents]

Contents

Syntax

The syntax for int definitions is:

f++:  
int definitions
int(definitions)
:=(int, definitions)
n++:  
@int definitions
@int(definitions)
@:=(int, definitions)

Note: If you are using the first syntax for variable definitions and want to have more code and/or text following on the same line then simply end the definition with ';'.

Description

The int type is used for integer values, though note that ExprTk will happily assign any floating point value to them (one limitation of ExprTk is that it only really works with doubles and strings).

Note: So that ExprTk has direct access to integers (for the sake of convenience), underneath they are actually doubles. If you are defining large volumes of integers where memory usage is of concern then std::int uses proper integers underneath, which you can still access from all of f++, ExprTk, Lua and n++, however accessing and setting them with ExprTk is not quite as nice syntactically and not as efficient.

Note: If you need to define thousands of variables then := is faster, plus it has useful error messages for unrecognised types.

Options

The following options are available for int definitions:

option description
const definition of a constant
!exprtk do not register variable with ExprTk
layer="x" define variable at layer x
private definition of a private
scope+="x" add x to scopes variable can be accessed from
option description

f++ example

Examples of int being defined with f++:

int a=10, b=12
int(x, y, z)
:=(int, count = 15)

n++ example

Examples of int being defined with n++:

@int a=10, b=12
@int(x, y, z)
@:=(int, count = 15)