Prepares a Telnet recording session consisting of binary data and text fields for later transmission to a terminal services server.
WebAPI.bdh
WebTelnetSendRecordPrepare( out hHandle : number, in sData : string ) : boolean;
true if the operation was successful
false otherwise
| Parameter | Description | 
|---|---|
| hHandle | Variable receiving the handle to the data record being prepared, to be used following commands WebTelnetSendRecordString and WebTelnetSendRecordExecute. | 
| sData | The binary data containing text fields that is to be prepared for later transmission to a terminal services server. | 
dcltrans
  transaction TInit
  begin
    StrSetHostCP(37); // 37    (IBM EBCDIC - U.S./Canada)
    ErrorAdd(FACILITY_WINSOCK, 18, SEVERITY_TRANS_EXIT);
  end TInit;
  transaction TMain
  var
    hHandle0 : number;
    hWeb0    : number;
  begin
    WebTcpipConnect(hWeb0, "My.Telnet.Host.IP", 5558);
    WebTcpipSetTelnetMode(hWeb0, TERMINAL_TYPE_3270, 80, 24, true, TELNET_MODEOPT_RFC_1576 | TELNET_MODEOPT_AUTO_RECV | 
      TELNET_MODEOPT_3270E_AUTO_REPLY);
    WebTelnetRecvCommand(hWeb0, TELNET_CMD_DO, TELNET_OPT_TN3270E);
    WebTelnetSendCommand(hWeb0, TELNET_CMD_WILL, TELNET_OPT_TN3270E);
    WebTelnetRecvSubNegotiation(hWeb0, TELNET_OPT_TN3270E);
    WebTelnetSendSubNegotiation(hWeb0, TELNET_OPT_TN3270E, TN3270E_CMD_DEVICE_TYPE + TN3270E_CMD_REQUEST + "IBM-3278-2-E");
    WebTelnetRecvSubNegotiation(hWeb0, TELNET_OPT_TN3270E);
    WebTelnetSendSubNegotiation(hWeb0, TELNET_OPT_TN3270E, TN3270E_CMD_FUNCTIONS + TN3270E_CMD_REQUEST + TN3270E_FUNC_BIND_IMAGE
       + TN3270E_FUNC_SYSREQ);
    WebTelnetRecvSubNegotiation(hWeb0, TELNET_OPT_TN3270E);
    WebTelnetSendSubNegotiation(hWeb0, TELNET_OPT_TN3270E, TN3270E_CMD_FUNCTIONS + TN3270E_CMD_IS);
    WebTelnetScreenRecvRecordsUntilCursor(hWeb0, 26, 10);
 
    ThinkTime(8.7);
    WebTelnetSendRecordPrepare(hHandle0, "\h00000000007D4C7E1140C4" + StrToHostCP("1") + "\h114BE9" + "%s1" + "\h114CC3" + "%s2"
       + "\h114CF9" + "%s3" + "\h114EC9" + "%s4" + "\h1150E9" + "%s5" + "\h115B61" + StrToHostCP(
      "Please type your userid.                                                       "));
    WebTelnetSetRecordString(hHandle0, "%s1", StrToHostCP("USER1   "));
    WebTelnetSetRecordString(hHandle0, "%s2", StrToHostCP("        "));
    WebTelnetSetRecordString(hHandle0, "%s3", StrToHostCP("USER1   "));
    WebTelnetSetRecordString(hHandle0, "%s4", StrToHostCP("   "));
    WebTelnetSetRecordString(hHandle0, "%s5", StrToHostCP("        "));
    WebTelnetSendRecordExecute(hWeb0, hHandle0);
    WebTelnetScreenRecvRecordsUntilStatus(hWeb0, "Keyboard locked", "False");
 
    ThinkTime(2.3);
    WebTelnetSendRecordPrepare(hHandle0, "\h00000000007D40C4" + StrToHostCP(
      "acctE0012I Signon complete at V00F, for user USER1. Local security is disabled. 13:17:29"));
    WebTelnetSendRecordExecute(hWeb0, hHandle0);
    WebTelnetScreenRecvRecordsUntilStatus(hWeb0, "Keyboard locked", "False");
 
    WebTelnetSendRecordPrepare(hHandle0, "\h00000000007D4AF3114AD5" + "%s3" + "\h114AE2" + "%s4");
    WebTelnetSetRecordString(hHandle0, "%s3", StrToHostCP("d"));
    WebTelnetSetRecordString(hHandle0, "%s4", StrToHostCP("12345"));
    WebTelnetSendRecordExecute(hWeb0, hHandle0);
    WebTelnetScreenRecvRecordsUntilStatus(hWeb0, "Keyboard locked", "False");
    ThinkTime(9.9);
    WebTelnetSendRecord(hWeb0, "\h00000000006D"); // •••••m
    WebTelnetRecvRecord(hWeb0);
 
    ThinkTime(2.1);
    WebTelnetSendRecordPrepare(hHandle0, "\h00000000007D40C4" + StrToHostCP("exit"));
    WebTelnetSendRecordExecute(hWeb0, hHandle0);
    WebTelnetRecvRecordsUntilClose(hWeb0);
    WebTcpipShutdown(hWeb0);
end TMain;