Methods

The ExpressionBuilder HTC supports the following methods:

  • Activate

  • Deactivate

  • GetResults

  • Save

  • Cancel

Activate(strMode, nExprID)

The Activate method activates the ExpressionBuilder HTC, indicating success with a return value of True, and failure with a return value of False.

The required strMode parameter indicates the mode in which the expression indicated by the required nExprID parameter, if any, is loaded. Legal values are 'create', 'createfrom', 'edit', and 'view'. If the value of strMode is 'create', the value of the nExprID parameter is ignored. Otherwise, the value of the nExprID parameter must be the ID of an expression in the expression store.

Example:

bResult = elExpBuilder.Activate("create", -1)

After calling the Activate method, you should wait for the IsReady event to fire or the IsReady property to become True. If the OnError event fires first, an asynchronous activation error has occurred.

Return to top

Deactivate

The Deactivate method deactivates the ExpressionBuilder HTC. It does not take any parameters, and the current expression information is not cleared.

Return to top

GetResults

The GetResults method returns the current ExpressionBuilder HTC status and results using a Scripting.Dictionary object. This Dictionary object contains the following entries:

  • The SavedExpr dictionary entry is set to True if the current expression has been successfully saved, and False otherwise. Expressions are saved as a result of successful create and save operations.

  • The ExprID dictionary entry contains the ID of the expression being manipulated. It is set to –1 (EXPR_INVALID) if the expression has not yet been saved.

  • The ExprName dictionary entry contains the current name of the expression, regardless of whether expression editing is complete.

  • The ExprBody dictionary entry contains the current XML representation of the expression, regardless of whether expression editing is complete.

The GetResults method does not take any parameters.

Example: oDictionary = elExpBuilder.GetResults()

Return to top

Save

Assuming that the activation mode is not 'view', the Save method saves the current expression. It returns True if the save operation is successful, and False otherwise.

Calling this method is equivalent to the user clicking the Save button. If successful, it fires the OnComplete event.

Return to top

Cancel

The Cancel method discards any unsaved editing of the current expression and disables the Expression Builder user interface. It does not return any value.

Calling this method is equivalent to the user clicking the Cancel button. If the user does not abort the cancellation, this method fires the OnComplete event.

Return to top


All rights reserved.