iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
4-47
Sockets Object
getMap(fml_table [,fml_table] [,fml_table] ...)
This method scans the buffer and returns an array of fml_field objects with one 
element for each field (not field occurrence) in the buffer. 
For example, this script prints out the names and values of fields in a buffer (fbfr). 
All occurrences of subscripted fields are printed.
 var emptbl=new atp.fml_table ("emp.tbl");
 var systbl=new atp.fml_table ("Usysflds");
 mapArray = fbfr.getMap (emptbl, systbl);
 for (i=0; i < mapArray.length; i++) {
 atp.print (mapArray[i].name+'\n');
 fldocc = fbfr.getOccurs(mapArray[i]);
 for (j=0; j < fldocc; j++)
 þatp.print (fbfr.getData (mapArray[i], j) + '\n');
 }
fml-table
This parameter contains a list of fml_field objects. The fml_table object 
parameters are used, in the order specified, to find the matching fml_field 
objects.
Sockets Object
This object enables you to develop scripts that use NonStop TCP/IP applications. For a 
discussion and example of using these objects, see Using TCP/IP Sockets from 
JavaScript on page 3-15.
atp.socket Object
The socket object represents a TCP/IP connection. The socket object allows the 
JavaScript script to act as a TCP/IP sockets client. The object provides basic sockets-
client functionality; some protocol options are not supported.
Constructors
new atp.socket(remote_host,remote_port)
new atp.socket(remote_host,remote_port,tcp/ip_process)
new atp.socket(remote_host,remote_port,tcp/ip_process,    
local_IP_address)
new atp.socket(remote_host,remote_port,tcp/ip_process,    
local_IP_address,local_port)
Note. The examples on the ATP product CD include a JavaScript class library that supports 
parts of the HTTP protocol. See the iurlclass server-side include file.










