AMT Help Files

COM Connection Interface

This section details the functions and properties of the AMT-COBOL COM connection object. This object encapsulates the connection to AMT-COBOL and the current transaction (i.e. the last transaction sent from the Transaction Server to the client application).

Properties



Name  Type  Access  Description 

ActiveFormName 

String 

Read/Write 

The name of the active form. If a new value is written to this property, this will become the current active form and sent on the next transmit. 

ApplicationName 

String 

Readonly 

The name of the application to which the AMT COM Module is connected to.

AverageResponseTime 

Integer 

Readonly 

Contains the average response time in milliseconds during the current connection. 

BaseAddress 

String 

Read/Write 

The base address of the Transaction Server to which the AMT COM Module will connect to. This property has to be set before the connection can be made. 

CleanupStationSessionsBooleanRead/Write

Please only use this property in cases where there will only be a single station connected to the application. This property, when set to True, will clear older "hanging" sessions upon connecting.

Connected 

Boolean 

Readonly 

Will be True when the AMT COM module is connected the Transaction Server.

Cursor 

String

Read/Write The name of the control item where the cursor is positioned. 
DebugModeBooleansRead/Write

Enables debug mode in the COM Module, which allows you to debug transactions from the COM Module in the AMT Debugger.

A username in the COM Module connection must be set with an identical username to the AMT Debugger username.

This property must be set before the OpenSession function is executed. The default value is false. 

DefaultLanguage 

String 

Readonly 

The default language of the Application the AMT COM Module is connected to. 

DisplayFieldCount 

Integer 

Readonly 

Contains the number of layout controls of the current form. 

FieldCount 

Integer 

Readonly 

Contains the number of fields of the current form 

FilterHighLighters 

Boolean 

Read/Write 

When set to True the layout controls are returned without HighLighters. 

FormCount 

Integer 

Readonly 

Contains the number of forms the user can access by Page2Recall. 

IgnoreReadOnly 

Boolean 

Read/Write 

When set to True, the readonly will be ignored. 

Language 

String 

Read/Write 

Contains the current set language for the application. 

LastError 

ResponseCode

Readonly 

Contains the response code of the last error after the execution of a function or subroutine. 0 HIFailed, 1 Ok, 2 OkLoging, 3 Timeout, 4 Server error, 5 System not responding, 6 Protocol error, 7 Disconnected, 8 Exception, 9 Waiting, 10 Error, 11 Ok bye, 12 No Transaction Server, 13 No active form.

ListCountIntegerReadonly

LogFileName 

String 

Readonly 

If logging is enabled this property contains the name of the logfile used. 

LogLevel 

LogLevelCode

Readonly

Contains the log level. 0 No logging, 1 Log errors, 2 Log all.  

NoErrors 

Integer 

Readonly 

Contains the number of errors in the error buffer. 

NoSessionData 

Boolean 

Read/Write 

When set to True, the Session data will not be saved. 

ResponseTime 

Integer 

Readonly 

Contains the response time in milliseconds. 

StationName 

String 

Read/Write

Contains the name of the station. 

StatusLine 

String 

Readonly 

Contains the current Status line of the application. 

Timeout 

Integer 

Read/Write 

Contains the Receive Timeout of the BasicHttpBinding. 

UserName 

String 

Read/Write 

Contains the username of the client connection. Defaults to the Windows username that uses the client program.



Functions and Subroutines


Name  Return type  Parameters  Description 
Type  Name 

CloseSession 

Void

--- 

Closes the session to the Transaction Server. 

DisableLogging 

Void 

--- 

 

Disables logging. 

EnableLogging 

Boolean 

LogLevelCode

LogLevel 

Enables logging with a set LogLevel to the given FileName. 

For the values of LogLevelCode, see COM Constants.

String 

FileName 

  
ExecuteProgram String 

String

Program Execute a program with parameters without GUI. 
Returns the result.

String

Parameters 
  

FormDescription 

String 

Integer 

Index 

Returns the description of the form specified by Index. 

FormName 

String 

Integer 

Index 

Returns the name of the form specified by Index that the client application can call with Page2Recall. 

FormText 

String 

--- 

 

Returns all the field names and values as a single string seperated by '@@' seperator sequences. 

GetCommAreaString---  

Retrieve the Communication area data used by transactions in an IBM CICS migrated environment.

GetDisplayField 

IAmtField 

Integer 

Index 

Returns the DisplayField for the specified Index. 

GetError 

String 

Integer 

ErrorNo 

Returns the description of the error specified by ErrorNo in the error message buffer. 

GetFieldByIndex 

IAmtField 

Integer 

Index 

Returns the Amt Field object for the field specified by Index.

GetFieldByName 

IAmtField 

String 

FieldName 

Returns the Amt Field object for the field specified by FieldName. 

OpenSession 

ResponseCode 

--- 

 

Opens a session to the Transaction Server and returns the response code of the operation. 0 HIFailed, 1 Ok, 2 OkLoging, 3 Timeout, 4 Server error, 5 System not responding, 6 Protocol error, 7 Disconnected, 8 Exception, 9 Waiting, 10 Error, 11 Ok bye, 12 No Transaction Server, 13 No active form.

OpenSession

ResponseCode String ApplicationName Opens a session to a specific Transaction Server and returns the response code of the operation. 
See above for the response codes.

An endpoint with this name must be present in the config file.

Page2Recall 

Boolean 

String 

FormName 

Tries to select a transaction specified by FormName as transaction code. Returns True on success and False on failure.

SetCommAreaVoidStringCommArea

Set the Communication area data to use for transactions in an IBM CICS migrated environment.

SetFieldValue 

Void 

String 

FieldName 

Sets the value of the field specified by FieldName to the value specified in Value. 

String 

Value 

  
SetKeyPressedValue Void

String

Value

Sets the key pressed value to imitate the usage of certain attention and function keys.

Possible values: ENTER, CLEAR, PA1 - PA3, PF1 - PF24. Other values will be ignored.

Shutdown 

Void 

---

 

Shutdown COM Module Environment. 

Transmit 

ResponseCode 

--- 

 

Transmit the current active form to the Transaction Server and returns the response code of the operation. 0 HIFailed, 1 Ok, 2 OkLogin, 3 Timeout, 4 Server error, 5 System not responding, 6 Protocol error, 7 Disconnected, 8 Exception, 9 Waiting, 10 Error, 11 Ok bye, 12 No Transaction Server, 13 No active form.

VersionNumber 

String 

--- 

 

Returns the full AMT version number, including also the patch- and fix number. 

WriteToLog 

Void 

String 

MsgText 

Write the text specified in MsgText to the logfile. 




Eventhandlers



Name  Description 

OnBye 

Event that is raised when the Transaction Server executes RECALL(BYE). The connection with the Transaction Server will be closed. 

OnErrorResponse 

Event that is raised when somewhere an error occurs. The error message can be questioned with NoErrors and GetError. 

OnFormResponse 

Event that is raised when the Transaction Server returns its message to the COM module. All fields are filled at that moment. 

OnSessionClosed 

Event that is raised when the connection between the Transaction Server and COM module is closed.