iTP Active Transaction Pages (iTP ATP) Programmer's Guide

ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
4-43
atp.fml_buffer Object
Example 3
The following constructor creates an atp.fml_table object with an incomplete set
of fields:
ftbl = new atp.fml_table ("emp.tbl", "FIRST_NAME", "LAST_NAME");
Using the fml_table object - a bankapp Transaction...
var ftbl = new atp.fml_table('bank.flds');
var fbfr = new atp.fml_buffer('fml');
fbfr.setData ("10040", ftbl.ACCOUNT_ID, 0);
fbfr.setData ("10041", ftbl.ACCOUNT_ID, 1);
fbfr.setData ("200.99", ftbl.SAMOUNT);
var tran = new atp.transaction ();
if (!fbfr.tpcall('TRANSFER', tran)) {
tran.rollback();
if (fbfr.error != 0)
return ('tpcall TRANSFER failed: ' + fbfr.error_text);
return (fbfr.reply.getData(ftbl.STATLIN));
}
tran.commit ();
atp.print ('Debit Account Balance: ' + fbfr.reply.getData(ftbl.SBALANCE) +
' ; Credit Account Balance: ' + fbfr.reply.getData(ftbl.SBALANCE, 1);
atp.fml_buffer Object
The fml_buffer object represents a FML or FML32 buffer. The tpcall() method
sends the buffer to a NonStop TUXEDO service.
Constructor
new atp.fml_buffer(fml_type [,buffer_size])
fml_type
This parameter specifies whether you want an FML or FML32 buffer. Specify the
string “fml” or “fml32”, depending on the requirements of the NonStop TUXEDO
service to which the buffer is to be sent.
buffer_size
This parameter specifies the size of the buffer. The default buffer size is 8192 bytes.
ATP automatically increases the size of the buffer as necessary, but it is more
efficient for the script to allocate a large enough buffer when creating the object.