Execute()

Allows you to execute a token command.

Syntax

WORD Execute(ANSISTRING CMD; ANSISTRING RetString;) 

Parameters

CMD As ANSISTRING

Token command string to send to GroupWise (example ’AboutDlg()’)

RetString As ANSISTRING

Empty string if token doesn't have a return value. Return string if token has a return value and execution succeeds. Error string if token execution fails.

Return Values

WORD. 0 if token execution fails. 1 if token execution succeeds.

Remarks

To get the currently logged in user ID, use the EnvUserID() token. The Pascal code to send this token is:

vCommander:=CreateOleObject('GroupWiseCommander'); 
Retval:=vCommander.Execute(’EnvUserID’,ReturnString)

ReturnString = the logged in GroupWise UserID string.

Retval = 1 for success

When calling the token commander execute method from .NET, you need to initialize the “RetString” output parameter with the correct type or you get a “Type Mismatch” exception from the .NET runtime. For example:

C#:

// Invalid: Produces "Type Mismatch"
string strResult;
commander.Execute("AboutDlg()", out strResult);

// Valid
string strResult = "";
commander.Execute(“AboutDlg()”, out strResult);

Visual Basic.NET:

// Invalid: Produces "Type Mismatch"
Dim strResult As String
commander.Execute("AboutDlg()", strResult)


// Valid
Dim strResult As String
strResult = “”
commander.Execute("AboutDlg()", strResult)