59
Is it possible to hide the context's images

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:ImageSize := 0
		oExpression:LineHeight := "dpi*16"
		oExpression:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/oGGtVKxGLxWNtsZtN8iUYuNvy0Zvd+xNYwdwvl4p870GCqc8vOeuVttmp1knyOayWVy+WzN/ze1wOElenm+12WUz/Bv2/3UyyWrzeutux2GSyGP2dQ33C1ur3GD3M4zUNzHdlWjq/E3nGzVpjWv4HA7fRy/Tv2IrN8rPW6nZ3ve7mUlfu20Z8acvQyb+vY9jasYoDwMm+LytVBDqKG3z8O3Cb8P+mkAuY9cCQ2uL4KaxDKvkp8RNLEjqugnrwQo/UWPzFyeQw5sNLZFENrI4kOqU66pw8uzmOKvTqNqjULJvGL1JO48GtT" +;
		"GsbLdEL3scxLlyiw8dQeoUVxdLTtyKmUjwGlslRPJsnK1HbAKbKCrsQo8uQk/CeP44iaR/ATnTNPLvyxPU+z9P9AUDQVBowiofJXQ6Oo+kKMpIkjztE4TKn4P6JowfgPnwD5/nAjB8AOeAPo0eAA1IAFH07UhAIMpYAVIYFHqBUhwVjV1S1EtQAHxW65V0AZwAeuQAnwB5gAPYViEDVhwAHTQBkCjB4gOhwDmCyhH0sACAg==")
		oExpression:Expression := "value format ``"
		oExpression:SplitPaneWidth := 312

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
58
ImageSize property on 32 (specifies the size of control' icons/images/check-boxes/radio-buttons)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:ImageSize := 32
		oExpression:Font():Size := 16
		oExpression:ToolTipFont():Size := 16
		oExpression:ToolTipWidth := 512
		oExpression:LineHeight := "dpi*32"
		oExpression:Images("gBJJgBAIDAAEg4AEEKAD/hz/EMNh8TIRNGwAjEZAEXjAojKAjMLjABhkaABAk0plUrlktl0vmExmUzmk1m03nE5nU7nk9miAoE+oVDolFo1HpFJpU5h8Sf9OqFNqUOqNUqdPq9VrFWrlbr1QpdhAFAkFis1ntFptVrtkrpszrNvmVxqk3uVtm1kmF3sdBvF/wGBmV+j9BYGHwWJulfxdax2NyFdx2JlV6l9Nw7AAGZymdz2Cy2GxErvWcz9ivlwyV21cuxugwktzGIzmvwtl0+53U5y0a0Wazmmyu/3dCyOMyXHx/J5nIr9q3uyqnBxFN3G46ma4vb7mD2Ng4nZze00fDkHC7t7us2rOX5tguetpHRlmz4HVqnXk1PjHO+CMPo9MBMC+j2vC8j7wS8cFNI4kBo05UIvfCT/NsnsApU+0Fqg/T+oy/kPxC0sEQfErKQK96+w28UWRI8UGvO8sTLS9r2PWmsMJTDTask3CsIbIEQRA3shOXEEAO/GclJ9" +;
		"FEKrrA8FRbKMXRIlb0JxCkjS1LMswhCcvuel0cv26cSMa8Ufx+2sQwhEUoSXOCjSbLcnxjKc7sdKUVyq28NtVI71P9P7JxtQEapjQ6fzfM8zPfNE2PhIsLL63E40slk5y7N89LcyU9SvMb3SdUc6VJLj5VLVLfO/PS9KzNFHUa/0XyBD0dxlS9cxhMlTRSoNXypPErWDPyfNS+MwprRNO0FD8wVVZ1AI08URwVRjtJ1WCn21QkkUrXVLVPQS/XIkFgTxT9iONZ9xVTdq+L1eKg3kkF6Upe68XtfV51/MtrVjBlwYFL1ev8y1/P6/lyzzYl02wntj0RVFmS1Qa+M5as93QxEUW9e993rfmQ2+vy65M/mL1lhl/2bj2ByVduMtNhCJT9hdz41nN14Ld12Z9UjfI/oUAaGseiw6+uFLLhcVabJOS5RqOE0BHlZ5VnEr5fOMs3st+aa/bbRzrJGV51Y0b0DbqaWXZD90hIsPbjWu52+6Wyadpe66hhO+P/Xi" +;
		"oW5rD8ZbrUZuVg6n1dsE/cXmewu1m9PVwnd35/nueXho/NaJzmjc61W76esuT77eG8pTquy9TwWH8LEzG8RDfFalx3Gcfvna9rvG/cptGLd9tuI6TZOP5Fiqi99vea+X4VRcBq/JZZtVQ9cwSs5lsXE372+a9z7PbfB3VVqHyvMctLto8uob6eV0m/cD6MN2v+T33t6sBut42vdv2bJ8a997x2maFJfK+qArbGJPEKE+1qTflMsIdW/GCJX17KcT6/czr/X+u1g29B7j/4BQfWkkx4zIHisjhPCmE0K4SwtXM+d4BvHRwNZOoBph9IJvPek9d40FoMJxf691jj2ywQQcHEWET4XJwkTszlVqm2GokewxtBT1DpQjRxDN0rUVDNKdC3lb6tzNOwh6upMSSYfv4YBCl/bsn9PxiFCEo7SI6Obc9HeOrnY8x4jtHtdpN4GRbaorhsbu18Pph5CiHymI0RpSXGJ/z2oUOxYxG858AyiI+bfJtuTcG5yelBJy" +;
		"T8okhqFd4a5yxL0rvulYtKCsZiWxWkc1s1cRoxxwhA31DLE0mR9l9HqX8fJgTDmFMVH0MIsRzVYnwnMi1dyzmhLt2kS2pxIiU62Wj5ptQGlSYFakLonTUJNLKaM5WzlffEkuFkk5wTrhVO2eE7G6lJhxFFYUZ55zmn0WuBCD4pzhirFCKkbomsOoIYmZx5p90LoYWGPdD5g0QmJRKYxbZ6zYoVQ2jVGylSak7KSkFH6RSjpHKFuU+YMyNo5SulkC6I0vonTCitMXPoEpVS2H5FQfEqp2R1opIgAEkJISYARTCukOhmPNI5Ex/wzGHUsicMwA1LHgQ90Y/KpoQHAD+pB/R4NzIaMAB9Xaw1gqaAOsh/A/ptIkWUfhGK1kZH8RgH5GqvgArqRmt4AAPrTroRofBGADkqr6Rmu4D7CEaHARiwpJrEEZsXXwlVjyMWRsaRqwdkLGNBABZmytmyMnaINZqyVpLR2ftKAAAdd6h2osbaskdiq4EZtgSmyNcbVW" +;
		"RJNXe3AA7REar3b0stlAAXBtoRmvJGLjEYAHUWsFcwCD/rnaop9aEICMAPdK5hT6xpeuzdOtAgKuJeGfdq6ggEbkTvAP+p9UCHXrvKkcgIA==")
		oExpression:Expression := "value format ``"
		oExpression:SplitPaneWidth := 312

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
57
ImageSize property on 16 (default) (specifies the size of control' icons)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:ImageSize := 16
		oExpression:LineHeight := "dpi*16"
		oExpression:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/oGGtVKxGLxWNtsZtN8iUYuNvy0Zvd+xNYwdwvl4p870GCqc8vOeuVttmp1knyOayWVy+WzN/ze1wOElenm+12WUz/Bv2/3UyyWrzeutux2GSyGP2dQ33C1ur3GD3M4zUNzHdlWjq/E3nGzVpjWv4HA7fRy/Tv2IrN8rPW6nZ3ve7mUlfu20Z8acvQyb+vY9jasYoDwMm+LytVBDqKG3z8O3Cb8P+mkAuY9cCQ2uL4KaxDKvkp8RNLEjqugnrwQo/UWPzFyeQw5sNLZFENrI4kOqU66pw8uzmOKvTqNqjULJvGL1JO48GtT" +;
		"GsbLdEL3scxLlyiw8dQeoUVxdLTtyKmUjwGlslRPJsnK1HbAKbKCrsQo8uQk/CeP44iaR/ATnTNPLvyxPU+z9P9AUDQVBowiofJXQ6Oo+kKMpIkjztE4TKn4P6JowfgPnwD5/nAjB8AOeAPo0eAA1IAFH07UhAIMpYAVIYFHqBUhwVjV1S1EtQAHxW65V0AZwAeuQAnwB5gAPYViEDVhwAHTQBkCjB4gOhwDmCyhH0sACAg==")
		oExpression:Expression := "value format ``"
		oExpression:SplitPaneWidth := 312

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
56
How can I convert the bytes to KB (kilo-bytes), MB (mega-bytes) or GB (giga-bytes)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 256
		oExpression:Expression := "int(0:=(1:=value)/1024/1024/1024) ? round(=:0*10)/10 + ` GB` : (int(0:==:1/1024/1024) ? round(=:0*10)/10 + ` MB` : (int(0:==:1/1024) ? round(=:0*10)/10 + ` KB` : =:1 + ` B`))"
		oExpression:EvaluationText := "value = 18\r\nvalue=1888\r\nvalue=18888888\r\nvalue=1888888888"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
55
Convert local time to Coordinated Universal Time (UTC)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "type(value) = 7 ? date(value + bias/24/60) : value"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
54
Convert Coordinated Universal Time (UTC) to local time

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "type(value) = 7 ? date(value - bias/24/60) : value"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
53
How can I show values with 1 decimal only if not integer such as 1.5, 2 (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "(((value format `1|,|3|,`) + `x`) replace `,0x` with ``) replace `x` with ``"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
52
How can I show values with 1 decimal only if not integer such as 1.5, 2 (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "value format `1|.|3|,` replace `.0` with ``"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
51
The sample displays the value in years, months, weeks, days, hours, minutes and secons

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "trim((1:=int((0:=value)/365) ? =:1 + ` year(s) ` : ``)  + (1:=int((0:=(=:0 - (=:1*365)))/31) ? =:1 + ` month(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*31)))/7) ? =:1 + ` week(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*7)))/1) ? =:1 + ` day(s) ` : ``) + (1:=int((0:=(=:0 - =:1 + 1/24/60/60/2))*24) ? =:1 + ` hour(s) ` : ``) + (1:=int((0:=(=:0*24 - =:1))*60) ? =:1 + ` min(s) ` : ``) + (1:=int((0:=(=:0*60 - =:1))*60) ? =:1 + ` sec(s)` : ``))"
		oExpression:EvaluationText := "value = 1\r\nvalue=2 + 1/24/60\r\nvalue=365 + 12 * 1/24\r\nvalue=1212.25\r\nvalue=366.02512"
		oExpression:SplitPaneWidth := 464

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
50
The sample displays the value in seconds

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "(1:=(int(0:=(value*24*60*60 + 1/24/60/60/2))) ? =: 1 + ` sec(s)` : ``)"
		oExpression:EvaluationText := "value = 1\r\nvalue=2 + 1/24/60\r\nvalue=365 + 12 * 1/24\r\nvalue=1212.25\r\nvalue=366.02512"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
49
The sample displays the value in minutes and seconds

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "trim((1:=(int(0:=(value*24*60 + 1/24/60/60/2))) ? =: 1 + ` min(s)` : ``) + ` ` + (2:=int((=:0 - =:1)*60) ? =:2 + ` sec(s)` : ``))"
		oExpression:EvaluationText := "value = 1\r\nvalue=2 + 1/24/60\r\nvalue=365 + 12 * 1/24\r\nvalue=1212.25\r\nvalue=366.02512"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
48
The sample displays the value in hours and minutes

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "((1:=int(0:=( 24*int(value) + (value - int(value) + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"
		oExpression:EvaluationText := "value = 1\r\nvalue=2 + 1/24/60\r\nvalue=365 + 12 * 1/24\r\nvalue=1212.25\r\nvalue=366.02512"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
47
How can I check for a blank-date (sample 3) Expression

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "type(value) case ( default : `<fgcolor=000000><s>invalid</s></fgcolor>`; 0 : `<fgcolor=FF0000>null</fgcolor>`; 1 : `null` ; 7 : longdate(value) )"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
46
How can I check for a blank-date (sample 2) Expression

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "len(value) ? longdate(value) : ``"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
45
How can I check for a blank-date (sample 1) Expression

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "type(value) = 7 ? longdate(value) : ``"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
44
Easter Sunday

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "date(dateS('3/1/' + year(value)) + ((1:=(((255 - 11 * (year(value) mod 19)) - 21) mod 30) + 21) + (=:1 > 48 ? -1 : 0) + 6 - ((year(value) + int(year(value) / 4)) + =:1 + (=:1 > 48 ? -1 : 0) + 1) mod 7))"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
43
The sample displays the value in days, hours and minutes

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
42
How can I display the date in short format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "shortdate(date(value))"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
41
How can I display the date in long format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "longdate(date(value))"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
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

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "type(value) in (0,1) ? 'null' : ( dbl(value)<0 ? '<fgcolor=FF0000>'+ (value format '2|.|3,' ) : (dbl(value)>0 ? '<fgcolor=0000FF>+'+(value format '2|.|3,' ): '0.00') ) "
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
39
How can I format a numeric value so it display as a currency

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "currency(dbl(value))"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
38
How can I format a numeric value to with grouping

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "dbl(value) format ''"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
37
How can I convert the value to a numeric ( integer ) value

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "int(value)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
36
How can I convert the value to a numeric ( double ) value

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "dbl(value)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
35
How can I format a date as YYYY-MMM-DD (sample 4)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "(year(value) + '-') + (month(value) array('','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) + '-' + (day(value)<10 ? '0' : '') + day(value)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
34
How can I format a date as YYYY-MMM-DD (sample 3)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "(2 array ( 0 := (shortdateF(value) split `/`) ) ) + `-`+ ((month(value) - 1) array `Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec` split ` `) + `-`+ (1 array =: 0)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
33
How can I format a date as YYYY-MMM-DD (sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "ltrim((2 array longdate(value) split `,`)) + `-` +  ((1 array (1 array longdate(value) split `,`) split ` `) left 3 ) + `-` + (`00` left (2 - len(day(value)))) + day(value)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
32
How can I format a date as YYYY-MMM-DD (sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "year(value) + `-` +  (month(value)-1 array ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) + `-` + (`00` left (2 - len(day(value)))) + day(value)"
		oExpression:SplitPaneWidth := 256

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
31
How can I use my own operators only

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AllowValueKeyword := .F.
		oExpression:AllowDefaultOperators := .F.
		oExpression:AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2)
		oExpression:AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0)
		oExpression:AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1)
		oExpression:AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2)
		oExpression:Text := "xxx + yyy(100 zzz 200)"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
30
How can I add a new binary-operator

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AddCustomOperator("xxx","<b>xxx</b>","This is a new binary-operator",2)
		oExpression:Text := "value + 100 xxx 200"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
29
How can I add a new unary-operator

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AddCustomOperator("xxx","<b>xxx</b>","This is a new unary-operator",1)
		oExpression:Text := "value + xxx(100)"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
28
How can I add a new keyword

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0)
		oExpression:Text := "value + xxx"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
27
How can I disable all operators
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AllowValueKeyword := .F.
		oExpression:AllowDefaultOperators := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
26
How can I disable the value keyword
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AllowValueKeyword := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
25
Usage of and ( and operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "(value contains 1) and (value != 1)"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
24
Usage of or ( or operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "(value=1) or value=`string`"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
23
Usage of not ( not operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "not(value=1)"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
22
Usage of - ( subtraction operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value - 2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
21
Usage of + ( addition operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value + 2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
20
Usage of mod ( reminder operator )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value mod 2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
19
Usage of / (divide operator)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value / 2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
18
Usage of * (multiplicity operator)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "2 * value"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
17
How can I get the word from cursor when user double clicks the control
PROCEDURE OnDblClick(oExpression,Shift,X,Y)
	DevOut( "Word: " )
	DevOut( oExpression:WordFromPoint(-1,-1) )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:DblClick := {|Shift,X,Y| OnDblClick(oExpression,Shift,X,Y)} /*Occurs when the user double clicks the left mouse button over an object.*/

		oExpression:Expression := "value"
		oExpression:AllowSplitter := 2/*exVSplitter*/
		oExpression:SplitPaneHeight := 196

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
16
How do I determine the word from the cursor
PROCEDURE OnClick(oExpression)
	DevOut( "Word: " )
	DevOut( oExpression:WordFromPoint(-1,-1) )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Click := {|| OnClick(oExpression)} /*Occurs when the user presses and then releases the left mouse button over the list control.*/

		oExpression:Expression := "value"
		oExpression:SplitPaneHeight := 196
		oExpression:SetProperty("Background",1/*exVSplitterApp*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oExpression:AllowSplitter := 2/*exVSplitter*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
15
How can I check if the expression is valid/syntactically correct
PROCEDURE OnChange(oExpression)
	DevOut( "Valid: " )
	DevOut( Transform(oExpression:IsValid(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Change := {|| OnChange(oExpression)} /*Indicates that the control's text has changed.*/

		oExpression:Expression := "value"
		oExpression:SplitPaneHeight := 196
		oExpression:SetProperty("Background",1/*exVSplitterApp*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oExpression:AllowSplitter := 2/*exVSplitter*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
14
How can I change the visual appearance of the horizontal splitter

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "value"
		oExpression:SplitPaneHeight := 196
		oExpression:SetProperty("Background",1/*exVSplitterApp*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oExpression:AllowSplitter := 2/*exVSplitter*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
13
How can I change the visual appearance of the vertical splitter

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "value"
		oExpression:SplitPaneWidth := 196
		oExpression:SetProperty("Background",0/*exHSplitterApp*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
12
How can I add a new menu-item to control's context menu
PROCEDURE OnExecuteContextMenu(oExpression,Item,Position)
	DevOut( "ExecuteContextMenu: " )
	DevOut( Transform(Item,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:ExecuteContextMenu := {|Item,Position| OnExecuteContextMenu(oExpression,Item,Position)} /*Occurs when the user selects an user item from the control's context menu.*/

		oExpression:Expression := "value + 100"
		oExpression:ContextMenuItems := "Test"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
11
How can I change the tooltip that shows when cursor hovers a keyword

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "value"
		oExpression:SetProperty("Description",0/*exKeywordValue*/,"This is a bit of text to be shown when cursor hovers the <b>value</b> keyword.")
		oExpression:Refresh()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
10
How do I check if the expression is correct
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "currency(value)"
		DevOut( Transform(oExpression:IsValid(),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
9
How do I programmatically evaluate the expression
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "currency(value)"
		DevOut( Transform(oExpression:Evaluate("value=100"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
8
How can I assign multiple values for variables %1, %2, ...

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "currency(%1 + %2)"
		oExpression:EvaluationText := "%1 = 100;%2 = 200"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
7
How can I change the values to show the result
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "currency(value)"
		oExpression:EvaluationText := "value = 100"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
6
How can I prevent changing the color when expression is invalid
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value 2"
		oExpression:SetProperty("ForeColorInvalid",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
5
How can I change the color when expression is invalid
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value 2"
		oExpression:SetProperty("ForeColorInvalid",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
4
How can I prevent evaluation the selection

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value + 1"
		oExpression:EvaluateSelection := .F.
		oExpression:HideSelection := .F.
		oExpression:SelLength := 1

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
3
How can I programatically show the result
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:SplitPaneWidth := 196
		oExpression:Expression := "value"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
2
How can I get ride of the right-vertical line/split
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:AllowSplitter := 0/*exNoSplitter*/
		oExpression:Expression := "value + 1"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1
How can I change the control's background
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExpression

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExpression := XbpActiveXControl():new( oForm:drawingArea )
	oExpression:CLSID  := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/
	oExpression:create(,, {10,60},{610,370} )

		oExpression:Expression := "value"
		oExpression:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN