fn: exprtk
[contents]

Contents

Syntax

The syntax for exprtk calls is:

f++:  
`expression`
exprtk{options}(expression)
exprtk{options}
{
	//block of ExprTk code
}

n++:  
@`expression`
@exprtk{options}(expression)
@exprtk{options}
{
	//block of ExprTk code
}

Description

The exprtk function is for compiling and evaluating ExprTk expressions, it takes zero parameters with the call followed by a block of ExprTk code to compile and evaluate otherwise a single parameter that should be the expression to be compiled and evaluated. See here for more information about ExprTk.

Options

The following options are available for exprtk calls:

option description
f++ use f++ if parsing block
n++ use n++ if parsing block
!o do not return output
o return output
pb parse block with language call is made from before compiling and evaluating with ExprTk
!round do not round value of ExprTk expression
option description

f++ example

Examples of exprtk being used with f++:

`var x:=0; nsm_write(console, x, endl)`
exprtk(var x:=0; nsm_write(console, x, endl))
exprtk.add_package(basicio_package)
exprtk
{
	for(var i:=0; i<10; i+=1)
	{
		println('i: ', i);
	}
}

n++ example

Example of exprtk being used with n++:

@`var x:=0; nsm_write(console, x, endl)`
@exprtk(var x:=0; nsm_write(console, x, endl))
@exprtk.add_package(basicio_package)
@exprtk
{
	for(var i:=0; i<10; i+=1)
	{
		println('i: ', i);
	}
}

Sponsors