Text/Initialization

Top  Previous  Next

Scripts > Class elements and c++ instructions > Input mask for class elements > Text/Initialization

 

Depending on the activation of the variable check box in the toolbar of an interpreter script

 

Variable_check

 

the editor field is used for initialization code of the variable or for the body of a function.

 

a) Initialization code

 

Optionally for each class variable an initialization code can be written, which will be executed every time the parsing of a new input text begins.

 

Example:

 

Name:        m_TotalPercent

Type:        int

Init:

m_TotalPercent = 100;

 

 

Name:        m_Numerals

Type:        mstrstr

Init:        

m_Numerals["eins"] = "one";

m_Numerals["zwei"] = "two";

m_Numerals["drei"] = "three";

m_Numerals["vier"] = "four";

m_Numerals["fünf"] = "five";

m_Numerals["sechs"] = "six";

m_Numerals["sieben"] = "seven";

m_Numerals["acht"] = "eight";

m_Numerals["neun"] = "nine";

 

 

 

b) Function body

 

The body of a function is written here.

 

Example:

 

Name:        abs

Type:        int

Parameter:        int xi

Text:

if(xi < 0)

xi = -xi;

return xi; 

 



This page belongs to the TextTransformer Documentation

Home  Content  German