LU 6.2 API Application Programmer's Reference Guide (30294-90008)

Appendix B 175
Sample Programs
Pascal Program
{************************************************************
BeginHouseKeeping
This procedure calls TPStarted to initialize resources
for the local TP, and then it calls MCAllocate to
allocate a conversation with the remote TP.
************************************************************}
procedure BeginHouseKeeping (LocalTPName : short_text;
RemoteTPNameASCII : TPNameType;
SessionType : short_text;
var TPID, ResourceID : shortint;
TraceOn : shortint;
var Quit_SW : boolean);
var
IntrinsicStatus : hpe_status;
RemoteTPNameEBCDIC : TPNameType;
begin
Quit_SW := NO_SW;
TPStarted (LocalTPName, TPID, IntrinsicStatus, TraceOn);
if IntrinsicStatus.all <<>> 0 then
ErrorHandler (StartedErrMsg, IntrinsicStatus.info, Quit_SW)
else
begin
CTranslate (TRANSLATE_TO_EBCDIC, RemoteTPNameASCII,
RemoteTPNameEBCDIC, LENGTH_REMOTE_TP_NAME);
if CCode = 1 then
begin
Quit_SW := YES_SW;
writeln (CTranslateErrMsg, 'CCL - Remote TP Name not translated.');
end
else
begin
MCAllocate (TPID, SessionType, RemoteTPNameEBCDIC,
LENGTH_REMOTE_TP_NAME, ResourceID, IntrinsicStatus);
if IntrinsicStatus.all <<>> 0 then
ErrorHandler (AllocateErrMsg, IntrinsicStatus.info, Quit_SW);
end;
end;
end;
$PAGE$