method CalcEdit.AddWildFormat (Expression as String)
Formats the line based on the giving wild characters expression.

TypeDescription
Expression as String A string expression that specifies the HTML format for a wild characters expression. The wild characters supported are '*' and '?'. Also the wild expression supports escaped characters, AddWild("<b>\*") bolds the * character only, not including the rest of the line, while AddWild("<b>\**") bolds everything after a * character.
By default, the control has already the wild format defined as "<i>*=*</i>", which draws in italics any line that includes the = (equal) character ( define the variables ). The AllowVariables property specifies the expression ( no HTML ) that defines the equal operator, so you can define variables. The AddWild method adds an expression that may contain wild characters like '*' or '?'. Use the FormatNumbers property to specify the format of the numbers in the control. The FormatResult property specifies the HTML format of the result. The FormatInvalid property specifies the HTML format to show invalid lines. The FormatTotalResult / FormatSubTotalResult  property formats the Total / Sub-Total lines. The FormatCountResult / FormatSubCountResult property specifies the HTML format of lines that contains Count or SubCount aggregate function. 

The list of supported built-in HTML tags is:

The DeleteWildFormat deletes an entry from the wild characters expressions collection. Use the ClearWildFormats method to clear the all wild characters expressions. The Refresh method should be called after DeleteWild method was called to reflect the latest changes.

The following samples show how you can define new variables using the "is" keyword, and highlight lines that includes it:

VBA (MS Access, Excell...)

With CalcEdit1
	.MultiLine = True
	.AllowVariables = "is"
	.ClearWildFormats 
	.AddWildFormat "<b>*is*"
	.Text = "A is 200"
	.InsertText ""
	.InsertText "B is A + 0.22"
	.InsertText "A + B"
	.InsertText "B is B * .19"
	.InsertText "A + B"
End With

VB6

With CalcEdit1
	.MultiLine = True
	.AllowVariables = "is"
	.ClearWildFormats 
	.AddWildFormat "<b>*is*"
	.Text = "A is 200"
	.InsertText ""
	.InsertText "B is A + 0.22"
	.InsertText "A + B"
	.InsertText "B is B * .19"
	.InsertText "A + B"
End With

VB.NET

With Excalcedit1
	.MultiLine = True
	.AllowVariables = "is"
	.ClearWildFormats()
	.AddWildFormat("<b>*is*")
	.Text = "A is 200"
	.InsertText("")
	.InsertText("B is A + 0.22")
	.InsertText("A + B")
	.InsertText("B is B * .19")
	.InsertText("A + B")
End With

VB.NET for /COM

With AxCalcEdit1
	.MultiLine = True
	.AllowVariables = "is"
	.ClearWildFormats()
	.AddWildFormat("<b>*is*")
	.Text = "A is 200"
	.InsertText("")
	.InsertText("B is A + 0.22")
	.InsertText("A + B")
	.InsertText("B is B * .19")
	.InsertText("A + B")
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXCALCEDITLib' for the library: 'ExCalcEdit 1.0 Control Library'

	#import <ExCalcEdit.dll>
	using namespace EXCALCEDITLib;
*/
EXCALCEDITLib::ICalcEditPtr spCalcEdit1 = GetDlgItem(IDC_CALCEDIT1)->GetControlUnknown();
spCalcEdit1->PutMultiLine(VARIANT_TRUE);
spCalcEdit1->PutAllowVariables(L"is");
spCalcEdit1->ClearWildFormats();
spCalcEdit1->AddWildFormat(L"<b>*is*");
spCalcEdit1->PutText(L"A is 200");
spCalcEdit1->InsertText(L"",vtMissing);
spCalcEdit1->InsertText(L"B is A + 0.22",vtMissing);
spCalcEdit1->InsertText(L"A + B",vtMissing);
spCalcEdit1->InsertText(L"B is B * .19",vtMissing);
spCalcEdit1->InsertText(L"A + B",vtMissing);

C++ Builder

CalcEdit1->MultiLine = true;
CalcEdit1->AllowVariables = L"is";
CalcEdit1->ClearWildFormats();
CalcEdit1->AddWildFormat(L"<b>*is*");
CalcEdit1->Text = L"A is 200";
CalcEdit1->InsertText(L"",TNoParam());
CalcEdit1->InsertText(L"B is A + 0.22",TNoParam());
CalcEdit1->InsertText(L"A + B",TNoParam());
CalcEdit1->InsertText(L"B is B * .19",TNoParam());
CalcEdit1->InsertText(L"A + B",TNoParam());

C#

excalcedit1.MultiLine = true;
excalcedit1.AllowVariables = "is";
excalcedit1.ClearWildFormats();
excalcedit1.AddWildFormat("<b>*is*");
excalcedit1.Text = "A is 200";
excalcedit1.InsertText("",null);
excalcedit1.InsertText("B is A + 0.22",null);
excalcedit1.InsertText("A + B",null);
excalcedit1.InsertText("B is B * .19",null);
excalcedit1.InsertText("A + B",null);

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:0D4EE794-3E13-4226-81F9-499EE6EDCCF7" id="CalcEdit1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	CalcEdit1.MultiLine = true;
	CalcEdit1.AllowVariables = "is";
	CalcEdit1.ClearWildFormats();
	CalcEdit1.AddWildFormat("<b>*is*");
	CalcEdit1.Text = "A is 200";
	CalcEdit1.InsertText("",null);
	CalcEdit1.InsertText("B is A + 0.22",null);
	CalcEdit1.InsertText("A + B",null);
	CalcEdit1.InsertText("B is B * .19",null);
	CalcEdit1.InsertText("A + B",null);
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:0D4EE794-3E13-4226-81F9-499EE6EDCCF7" id="CalcEdit1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With CalcEdit1
		.MultiLine = True
		.AllowVariables = "is"
		.ClearWildFormats 
		.AddWildFormat "<b>*is*"
		.Text = "A is 200"
		.InsertText ""
		.InsertText "B is A + 0.22"
		.InsertText "A + B"
		.InsertText "B is B * .19"
		.InsertText "A + B"
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axCalcEdit1.MultiLine = true;
axCalcEdit1.AllowVariables = "is";
axCalcEdit1.ClearWildFormats();
axCalcEdit1.AddWildFormat("<b>*is*");
axCalcEdit1.Text = "A is 200";
axCalcEdit1.InsertText("",null);
axCalcEdit1.InsertText("B is A + 0.22",null);
axCalcEdit1.InsertText("A + B",null);
axCalcEdit1.InsertText("B is B * .19",null);
axCalcEdit1.InsertText("A + B",null);

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	excalcedit1.MultiLine(true);
	excalcedit1.AllowVariables("is");
	excalcedit1.ClearWildFormats();
	excalcedit1.AddWildFormat("<b>*is*");
	excalcedit1.Text("A is 200");
	excalcedit1.InsertText("");
	excalcedit1.InsertText("B is A + 0.22");
	excalcedit1.InsertText("A + B");
	excalcedit1.InsertText("B is B * .19");
	excalcedit1.InsertText("A + B");
}

Delphi 8 (.NET only)

with AxCalcEdit1 do
begin
	MultiLine := True;
	AllowVariables := 'is';
	ClearWildFormats();
	AddWildFormat('<b>*is*');
	Text := 'A is 200';
	InsertText('',Nil);
	InsertText('B is A + 0.22',Nil);
	InsertText('A + B',Nil);
	InsertText('B is B * .19',Nil);
	InsertText('A + B',Nil);
end

Delphi (standard)

with CalcEdit1 do
begin
	MultiLine := True;
	AllowVariables := 'is';
	ClearWildFormats();
	AddWildFormat('<b>*is*');
	Text := 'A is 200';
	InsertText('',Null);
	InsertText('B is A + 0.22',Null);
	InsertText('A + B',Null);
	InsertText('B is B * .19',Null);
	InsertText('A + B',Null);
end

VFP

with thisform.CalcEdit1
	.MultiLine = .T.
	.AllowVariables = "is"
	.ClearWildFormats
	.AddWildFormat("<b>*is*")
	.Text = "A is 200"
	.InsertText("")
	.InsertText("B is A + 0.22")
	.InsertText("A + B")
	.InsertText("B is B * .19")
	.InsertText("A + B")
endwith

dBASE Plus

local oCalcEdit

oCalcEdit = form.EXCALCEDITACTIVEXCONTROL1.nativeObject
oCalcEdit.MultiLine = true
oCalcEdit.AllowVariables = "is"
oCalcEdit.ClearWildFormats()
oCalcEdit.AddWildFormat("<b>*is*")
oCalcEdit.Text = "A is 200"
oCalcEdit.InsertText("")
oCalcEdit.InsertText("B is A + 0.22")
oCalcEdit.InsertText("A + B")
oCalcEdit.InsertText("B is B * .19")
oCalcEdit.InsertText("A + B")

XBasic (Alpha Five)

Dim oCalcEdit as P

oCalcEdit = topparent:CONTROL_ACTIVEX1.activex
oCalcEdit.MultiLine = .t.
oCalcEdit.AllowVariables = "is"
oCalcEdit.ClearWildFormats()
oCalcEdit.AddWildFormat("<b>*is*")
oCalcEdit.Text = "A is 200"
oCalcEdit.InsertText("")
oCalcEdit.InsertText("B is A + 0.22")
oCalcEdit.InsertText("A + B")
oCalcEdit.InsertText("B is B * .19")
oCalcEdit.InsertText("A + B")

Visual Objects


oDCOCX_Exontrol1:MultiLine := true
oDCOCX_Exontrol1:AllowVariables := "is"
oDCOCX_Exontrol1:ClearWildFormats()
oDCOCX_Exontrol1:AddWildFormat("<b>*is*")
oDCOCX_Exontrol1:Text := "A is 200"
oDCOCX_Exontrol1:InsertText("",nil)
oDCOCX_Exontrol1:InsertText("B is A + 0.22",nil)
oDCOCX_Exontrol1:InsertText("A + B",nil)
oDCOCX_Exontrol1:InsertText("B is B * .19",nil)
oDCOCX_Exontrol1:InsertText("A + B",nil)

PowerBuilder

OleObject oCalcEdit

oCalcEdit = ole_1.Object
oCalcEdit.MultiLine = true
oCalcEdit.AllowVariables = "is"
oCalcEdit.ClearWildFormats()
oCalcEdit.AddWildFormat("<b>*is*")
oCalcEdit.Text = "A is 200"
oCalcEdit.InsertText("")
oCalcEdit.InsertText("B is A + 0.22")
oCalcEdit.InsertText("A + B")
oCalcEdit.InsertText("B is B * .19")
oCalcEdit.InsertText("A + B")

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComMultiLine to True
	Set ComAllowVariables to "is"
	Send ComClearWildFormats
	Send ComAddWildFormat "<b>*is*"
	Set ComText to "A is 200"
	Send ComInsertText "" Nothing
	Send ComInsertText "B is A + 0.22" Nothing
	Send ComInsertText "A + B" Nothing
	Send ComInsertText "B is B * .19" Nothing
	Send ComInsertText "A + B" Nothing
End_Procedure

XBase++

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

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

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

	oCalcEdit := XbpActiveXControl():new( oForm:drawingArea )
	oCalcEdit:CLSID  := "Exontrol.CalcEdit.1" /*{0D4EE794-3E13-4226-81F9-499EE6EDCCF7}*/
	oCalcEdit:create(,, {10,60},{610,370} )

		oCalcEdit:MultiLine := .T.
		oCalcEdit:AllowVariables := "is"
		oCalcEdit:ClearWildFormats()
		oCalcEdit:AddWildFormat("<b>*is*")
		oCalcEdit:Text := "A is 200"
		oCalcEdit:InsertText("")
		oCalcEdit:InsertText("B is A + 0.22")
		oCalcEdit:InsertText("A + B")
		oCalcEdit:InsertText("B is B * .19")
		oCalcEdit:InsertText("A + B")

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