51:
The sample displays the value in years, months, weeks, days, hours, minutes and secons

public void init()
{
	str var_s;
	;

	super();

	var_s = "trim((1:=int((0:=value)/365) ? =:1 + ` year(s) ` : ``)  + (1:=int((0:=(=:0 - (=:1*365)))/31) ? =:1 + ` month(s) ` : ``) + (1:=in";
	var_s = var_s + "t((0:=(=:0 - (=:1*31)))/7) ? =:1 + ` week(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*7)))/1) ? =:1 + ` day(s) ` : ``) + (1:=int((0:=(=";
	var_s = var_s + ":0 - =:1 + 1/24/60/60/2))*24) ? =:1 + ` hour(s) ` : ``) + (1:=int((0:=(=:0*24 - =:1))*60) ? =:1 + ` min(s) ` : ``) + (1:=int((0:";
	var_s = var_s + "=(=:0*60 - =:1))*60) ? =:1 + ` sec(s)` : ``))";
	expression1.Expression(var_s);
	expression1.EvaluationText("value = 1\\r\\nvalue=2 + 1/24/60\\r\\nvalue=365 + 12 * 1/24\\r\\nvalue=1212.25\\r\\nvalue=366.02512");
	expression1.SplitPaneWidth(464);
}
50:
The sample displays the value in seconds

public void init()
{
	;

	super();

	expression1.Expression("(1:=(int(0:=(value*24*60*60 + 1/24/60/60/2))) ? =: 1 + ` sec(s)` : ``)");
	expression1.EvaluationText("value = 1\\r\\nvalue=2 + 1/24/60\\r\\nvalue=365 + 12 * 1/24\\r\\nvalue=1212.25\\r\\nvalue=366.02512");
	expression1.SplitPaneWidth(256);
}
49:
The sample displays the value in minutes and seconds

public void init()
{
	str var_s;
	;

	super();

	var_s = "trim((1:=(int(0:=(value*24*60 + 1/24/60/60/2))) ? =: 1 + ` min(s)` : ``) + ` ` + (2:=int((=:0 - =:1)*60) ? =:2 + ` sec(s)` : ``)";
	var_s = var_s + ")";
	expression1.Expression(var_s);
	expression1.EvaluationText("value = 1\\r\\nvalue=2 + 1/24/60\\r\\nvalue=365 + 12 * 1/24\\r\\nvalue=1212.25\\r\\nvalue=366.02512");
	expression1.SplitPaneWidth(256);
}
48:
The sample displays the value in hours and minutes

public void init()
{
	str var_s;
	;

	super();

	var_s = "((1:=int(0:=( 24*int(value) + (value - int(value) + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1";
	var_s = var_s + ":=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')";
	expression1.Expression(var_s);
	expression1.EvaluationText("value = 1\\r\\nvalue=2 + 1/24/60\\r\\nvalue=365 + 12 * 1/24\\r\\nvalue=1212.25\\r\\nvalue=366.02512");
	expression1.SplitPaneWidth(256);
}
47:
How can I check for a blank-date (sample 3) Expression

public void init()
{
	str var_s;
	;

	super();

	var_s = "type(value) case ( default : `<fgcolor=000000><s>invalid</s></fgcolor>`; 0 : `<fgcolor=FF0000>null</fgcolor>`; 1 : `null` ; 7 : ";
	var_s = var_s + "longdate(value) )";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
46:
How can I check for a blank-date (sample 2) Expression

public void init()
{
	;

	super();

	expression1.Expression("len(value) ? longdate(value) : ``");
	expression1.SplitPaneWidth(256);
}
45:
How can I check for a blank-date (sample 1) Expression

public void init()
{
	;

	super();

	expression1.Expression("type(value) = 7 ? longdate(value) : ``");
	expression1.SplitPaneWidth(256);
}
44:
Easter Sunday

public void init()
{
	str var_s;
	;

	super();

	var_s = "date(dateS('3/1/' + year(value)) + ((1:=(((255 - 11 * (year(value) mod 19)) - 21) mod 30) + 21) + (=:1 > 48 ? -1 : 0) + 6 - ((ye";
	var_s = var_s + "ar(value) + int(year(value) / 4)) + =:1 + (=:1 > 48 ? -1 : 0) + 1) mod 7))";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
43:
The sample displays the value in days, hours and minutes

public void init()
{
	str var_s;
	;

	super();

	var_s = "((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ?";
	var_s = var_s + " =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
42:
How can I display the date in short format

public void init()
{
	;

	super();

	expression1.Expression("shortdate(date(value))");
	expression1.SplitPaneWidth(256);
}
41:
How can I display the date in long format

public void init()
{
	;

	super();

	expression1.Expression("longdate(date(value))");
	expression1.SplitPaneWidth(256);
}
40:
The sample displays the positive values in blue, being preceded by + sign, negative values in red preceded by - sign, 0 as 0.00 while for null values is displays null. The numbers are displayed using 2 digits, . as decimal separator and grouping by 3 digits by , separator

public void init()
{
	str var_s;
	;

	super();

	var_s = "type(value) in (0,1) ? 'null' : ( dbl(value)<0 ? '<fgcolor=FF0000>'+ (value format '2|.|3,' ) : (dbl(value)>0 ? '<fgcolor=0000FF";
	var_s = var_s + ">+'+(value format '2|.|3,' ): '0.00') ) ";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
39:
How can I format a numeric value so it display as a currency

public void init()
{
	;

	super();

	expression1.Expression("currency(dbl(value))");
	expression1.SplitPaneWidth(256);
}
38:
How can I format a numeric value to with grouping

public void init()
{
	;

	super();

	expression1.Expression("dbl(value) format ''");
	expression1.SplitPaneWidth(256);
}
37:
How can I convert the value to a numeric ( integer ) value

public void init()
{
	;

	super();

	expression1.Expression("int(value)");
	expression1.SplitPaneWidth(256);
}
36:
How can I convert the value to a numeric ( double ) value

public void init()
{
	;

	super();

	expression1.Expression("dbl(value)");
	expression1.SplitPaneWidth(256);
}
35:
How can I format a date as YYYY-MMM-DD (sample 4)

public void init()
{
	str var_s;
	;

	super();

	var_s = "(year(value) + '-') + (month(value) array('','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) + '-' + (";
	var_s = var_s + "day(value)<10 ? '0' : '') + day(value)";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
34:
How can I format a date as YYYY-MMM-DD (sample 3)

public void init()
{
	str var_s;
	;

	super();

	var_s = "(2 array ( 0 := (shortdateF(value) split `/`) ) ) + `-`+ ((month(value) - 1) array `Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov ";
	var_s = var_s + "Dec` split ` `) + `-`+ (1 array =: 0)";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
33:
How can I format a date as YYYY-MMM-DD (sample 2)

public void init()
{
	str var_s;
	;

	super();

	var_s = "ltrim((2 array longdate(value) split `,`)) + `-` +  ((1 array (1 array longdate(value) split `,`) split ` `) left 3 ) + `-` + (`";
	var_s = var_s + "00` left (2 - len(day(value)))) + day(value)";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
32:
How can I format a date as YYYY-MMM-DD (sample 1)

public void init()
{
	str var_s;
	;

	super();

	var_s = "year(value) + `-` +  (month(value)-1 array ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) + `-` + (`";
	var_s = var_s + "00` left (2 - len(day(value)))) + day(value)";
	expression1.Expression(var_s);
	expression1.SplitPaneWidth(256);
}
31:
How can I use my own operators only

public void init()
{
	;

	super();

	expression1.AllowValueKeyword(false);
	expression1.AllowDefaultOperators(false);
	expression1.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",COMVariant::createFromInt(2));
	expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",COMVariant::createFromInt(0));
	expression1.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",COMVariant::createFromInt(1));
	expression1.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",COMVariant::createFromInt(2));
	expression1.Text("xxx + yyy(100 zzz 200)");
}
30:
How can I add a new binary-operator

public void init()
{
	;

	super();

	expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new binary-operator",COMVariant::createFromInt(2));
	expression1.Text("value + 100 xxx 200");
}
29:
How can I add a new unary-operator

public void init()
{
	;

	super();

	expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new unary-operator",COMVariant::createFromInt(1));
	expression1.Text("value + xxx(100)");
}
28:
How can I add a new keyword

public void init()
{
	;

	super();

	expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",COMVariant::createFromInt(0));
	expression1.Text("value + xxx");
}
27:
How can I disable all operators
public void init()
{
	;

	super();

	expression1.AllowValueKeyword(false);
	expression1.AllowDefaultOperators(false);
}
26:
How can I disable the value keyword
public void init()
{
	;

	super();

	expression1.AllowValueKeyword(false);
}
25:
Usage of and ( and operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("(value contains 1) and (value != 1)");
}
24:
Usage of or ( or operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("(value=1) or value=`string`");
}
23:
Usage of not ( not operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("not(value=1)");
}
22:
Usage of - ( subtraction operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value - 2");
}
21:
Usage of + ( addition operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value + 2");
}
20:
Usage of mod ( reminder operator )

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value mod 2");
}
19:
Usage of / (divide operator)

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value / 2");
}
18:
Usage of * (multiplicity operator)

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("2 * value");
}
17:
How can I get the word from cursor when user double clicks the control
// DblClick event - Occurs when the user double clicks the left mouse button over an object.
void onEvent_DblClick(int   _Shift,int   _X,int   _Y)
{
	;
	print( "Word: " );
	print( expression1.WordFromPoint(-1,-1) );
}

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.AllowSplitter(2/*exVSplitter*/);
	expression1.SplitPaneHeight(196);
}
16:
How do I determine the word from the cursor
// Click event - Occurs when the user presses and then releases the left mouse button over the list control.
void onEvent_Click()
{
	;
	print( "Word: " );
	print( expression1.WordFromPoint(-1,-1) );
}

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.SplitPaneHeight(196);
	expression1.Background(1/*exVSplitterApp*/,WinApi::RGB2int(240,240,240));
	expression1.AllowSplitter(2/*exVSplitter*/);
}
15:
How can I check if the expression is valid/syntactically correct
// Change event - Indicates that the control's text has changed.
void onEvent_Change()
{
	;
	print( "Valid: " );
	print( expression1.IsValid() );
}

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.SplitPaneHeight(196);
	expression1.Background(1/*exVSplitterApp*/,WinApi::RGB2int(240,240,240));
	expression1.AllowSplitter(2/*exVSplitter*/);
}
14:
How can I change the visual appearance of the horizontal splitter

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.SplitPaneHeight(196);
	expression1.Background(1/*exVSplitterApp*/,WinApi::RGB2int(240,240,240));
	expression1.AllowSplitter(2/*exVSplitter*/);
}
13:
How can I change the visual appearance of the vertical splitter

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.SplitPaneWidth(196);
	expression1.Background(0/*exHSplitterApp*/,WinApi::RGB2int(240,240,240));
}
12:
How can I add a new menu-item to control's context menu
// ExecuteContextMenu event - Occurs when the user selects an user item from the control's context menu.
void onEvent_ExecuteContextMenu(str   _Item,int   _Position)
{
	;
	print( "ExecuteContextMenu: " );
	print( _Item );
}

public void init()
{
	;

	super();

	expression1.Expression("value + 100");
	expression1.ContextMenuItems("Test");
}
11:
How can I change the tooltip that shows when cursor hovers a keyword

public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.Description(0/*exKeywordValue*/,"This is a bit of text to be shown when cursor hovers the <b>value</b> keyword.");
	expression1.Refresh();
}
10:
How do I check if the expression is correct
public void init()
{
	;

	super();

	expression1.Expression("currency(value)");
	print( expression1.IsValid() );
}
9:
How do I programmatically evaluate the expression
public void init()
{
	;

	super();

	expression1.Expression("currency(value)");
	print( expression1.Evaluate("value=100") );
}
8:
How can I assign multiple values for variables %1, %2, ...

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("currency(%1 + %2)");
	expression1.EvaluationText("%1 = 100;%2 = 200");
}
7:
How can I change the values to show the result
public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("currency(value)");
	expression1.EvaluationText("value = 100");
}
6:
How can I prevent changing the color when expression is invalid
public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value 2");
	expression1.ForeColorInvalid(WinApi::RGB2int(0,0,0));
}
5:
How can I change the color when expression is invalid
public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value 2");
	expression1.ForeColorInvalid(WinApi::RGB2int(255,0,0));
}
4:
How can I prevent evaluation the selection

public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value + 1");
	expression1.EvaluateSelection(false);
	expression1.HideSelection(false);
	expression1.SelLength(1);
}
3:
How can I programatically show the result
public void init()
{
	;

	super();

	expression1.SplitPaneWidth(196);
	expression1.Expression("value");
}
2:
How can I get ride of the right-vertical line/split
public void init()
{
	;

	super();

	expression1.AllowSplitter(0/*exNoSplitter*/);
	expression1.Expression("value + 1");
}
1:
How can I change the control's background
public void init()
{
	;

	super();

	expression1.Expression("value");
	expression1.BackColor(WinApi::RGB2int(240,240,240));
}