Routines for ema_cli.kb


AppendOriginalBodyToOutput

File Name

ema_cli.kb

Syntax

AppendOriginalBodyToOutput(REF commandData:SingleCommandRec, REF target:STRING );

Parameters

commandData - the command description block

Returns

Nothing

Side Effects

None

Description

This routine appends the original message body (if there is one) to the output field.

Dialog Forms Called

None


CleanupMessage

File Name

ema_cli.kb

Syntax

CleanupMessage( REF msg:STRING );

Parameters

msg - new message content

Returns

Nothing

Side Effects

None

Description

This function scans a message for "bad characters" and replaces each occurrence with a blank character.

Dialog Forms Called

None


CleanupUserReply

File Name

ema_cli.kb

Syntax

CleanupUserReply( REF msg:STRING );

Parameters

str - string content

Returns

The modified input string

Side Effects

None

Description

This function scans a string for embedded "sentinel" text that indicates the beginning and end of the original user message. All text other than the original message is deleted.

Dialog Forms Called

None


CLIBuildAlternateBody

File Name

ema_cli.kb

Syntax

CLIBuildAlternateBody(REF commandData:SingleCommandRec,

Parameters

commandData - the command description block

Returns

Nothing

Side Effects

None

Description

This routine builds the message for the alternateBody field which becomes the main message when an attachment is sent (the outputBody becomes the attachment).

Dialog Forms Called

None


CLIExecuteCommand

File Name

ema_cli.kb

Syntax

CLIExecuteCommand( REF commandblock:CLIDataRec);

Parameters

commandBlock - block containing all user input

Essentially, the caller should fill in the command body sections; all others

will be reset here.

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs the execution of the command already parsed into this command block. You should call this function even if the ParseCommand function returned an error code.

Dialog Forms Called

None


CLIInitialize

File Name

ema_cli.kb

Syntax

CLIInitialize( REF commandblock:CLIDataRec);

Parameters

commandBlock - block containing all user input

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine performs initialization of the data structure to be used as the master command structure.

Dialog Forms Called

None


CLIParseCommand

File Name

ema_cli.kb

Syntax

CLIParseCommand( REF commandblock:CLIDataRec);

Parameters

commandBlock - block containing all user input

Essentially, the caller should fill in the command body sections; all others

will be reset here.

Returns

1 = success

CLI_ERR_USER_INPUT = some kind of user input error

Side Effects

None

Description

This routine performs general parsing of the command string as it exists in the command block.

Dialog Forms Called

None


CLIProcessBrowseHelp

File Name

ema_cli.kb

Syntax

CLIProcessBrowseHelp(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for Help.

Dialog Forms Called

None


CLIProcessBrowseProb

File Name

ema_cli.kb

Syntax

CLIProcessBrowseProb(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Browse Problem user command.

Dialog Forms Called

None


CLIProcessBrowseSoln

File Name

ema_cli.kb

Syntax

CLIProcessBrowseSoln(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - op to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Browse Solution user command.

Dialog Forms Called

None


CLIProcessComment

File Name

ema_cli.kb

Syntax

CLIProcessComment(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation- operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Submit Comment user command.

Dialog Forms Called

None


CLIProcessDiagnoseProb

File Name

ema_cli.kb

Syntax

CLIProcessDiagnoseProb(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Diagnose Problem user command.

Dialog Forms Called

None


CLIProcessSubmitProb

File Name

ema_cli.kb

Syntax

CLIProcessSubmitProb(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Submit Problem user command.

Dialog Forms Called

None


CLIProcessUpdateProb

File Name

ema_cli.kb

Syntax

CLIProcessUpdateProb(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Update Problem user command.

Dialog Forms Called

None


CLIProcessUseSoln

File Name

ema_cli.kb

Syntax

CLIProcessUseSoln(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user to register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the Use Solution user command.

Dialog Forms Called

None


CLIProcessViewProb

File Name

ema_cli.kb

Syntax

CLIProcessViewProb(REF commandData:SingleCommandRec, VAL operation:INTEGER);

Parameters

commandData - the command description block

operation - operation to perform: PARSE, EXECUTE, HELP

Returns

1 = success

CLI_ERR_USER_INPUT - some kind of user input error

CLI_ERR_USER_NOT_REGISTERED - command required user register

ERR_NONFATAL - a non-fatal execution error occurred

ERR_FATAL - a fatal execution error occurred

CLI_ERR_INTERNAL - an internal error occurred

Side Effects

None

Description

This routine performs all processing for the View Problem user command.

Dialog Forms Called

None


CLIShutDown

File Name

ema_cli.kb

Syntax

CLIShutDown;

Parameters

None

Returns

1 = success

-n = failure: return codes from TerminateADL

Side Effects

None

Description

This routine performs final shutdown operations. The call to this routine should be the last line of your main program.

Dialog Forms Called

None


CLITest

File Name

ema_cli.kb

Syntax

CLITest( VAL args:LIST OF STRING);

Parameters

args - command line argument list

Returns

None

Side Effects

None

Description

This routine is the interactive test for this module.

Dialog Forms Called

None


ModuleTestEventHandler

File Name

ema_cli.kb

Syntax

ModuleTestEventHandler( REF eventData: CLIDataRec);

Parameters

eventData - instance data for this dialog box type

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine updates the screen.

Dialog Forms Called

None


ParseNextAsNoun

File Name

ema_cli.kb

Syntax

ParseNextAsNoun(REF commandData:SingleCommandRec);

Parameters

commandData - block containing all user input

Returns

>0 = success

0 = there was nothing to parse (end of string?)

-1 = unrecongnized noun

Side Effects

None

Description

This routine determines which command noun was entered.

Dialog Forms Called

None


ParseNextAsVerb

File Name

ema_cli.kb

Syntax

ParseNextAsVerb(REF commandData:SingleCommandRec);

Parameters

commandData - block containing all user input

Returns

>0 = success

0 = there was nothing to parse (end of string?)

-1 = unrecongnized noun

Side Effects

None

Description

This routine determines which command verb was entered.

Dialog Forms Called

None


ParseRemainder

File Name

ema_cli.kb

Syntax

ParseRemainder(REF commandData:SingleCommandRec, VAL operation:INTEGER );

Parameters

commandData - block containing all user input

operation - operation code for CLIProcessXxxx

Returns

>0 = success

-1 = unable to parse noun

-n = any error code from CLIProcessXxxx routine.

Side Effects

The .errorCode and .outputBody fields will be set in arg1

Description

This routine finishes the parsing beyond the command verb. Because some verbs take arguments and some do not, this routine dispatches to the parsing routine for the various verb types.

Dialog Forms Called

None


RefreshTestFields

File Name

ema_cli.kb

Syntax

RefreshTestFields( VAL dlgWindow:WINDOW, REF eventData: SingleCommandRec );

Parameters

eventData - instance data for this dialog box type

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine updates the screen.

Dialog Forms Called

None