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-50
Global Functions
Global Functions
The following functions are useful for many kinds of scripts:
atp.execute (path)
This method calls an ATP file and processes it as if it were part of the calling ATP script.
The atp.execute method is similar and is an alternative to the server-side include tag.
The path parameter must be specified. This is a string specifying the location of the ATP
file to execute. The path must be relative to the calling page.
The atp.execute method provides a way for you to divide a complex application into
individual modules. Using this method you can develop a library of ATP files that you
can call as needed. After ATP processes the specified file, the response is returned to the
calling ATP script.
The following example demonstrates executing an ATP file that returns some text.
The text to be returned is
I am at Page One
I am at Page Two
I am back at Page One again
The code fragments are:
Page1.atp
<HTML><BODY>
<server>
atp.print (“I am at Page One <BR>”);
atp.execute (“Page2.atp”);
atp.print (“I am back at Page One again <BR>”);
. . .
Page2.atp
<% atp.print (“I am at Page Two<BR>”)%>
atp.print(JavaScript_expression)
This function is used to output results from the server-side script. The output from the
script logically replaces the script within the .atp page as the page is processed. The
web browser sees only the output of a server-side script, not the script itself.
You can use HTML in the clear in your script. Do not use the atp.print function to send
the HTML to the browser. ATP automatically sends the HTML to the browser more
efficiently than your script can do it using atp.print.
atp.println()
This function is the same as the atp.print function, except that it prints an extra new line.