You start a transaction by indicating to Net.Data that a macro is persistent in your macro before any output is sent to the browser. Net.Data then sends a special HTTP header to the Web server to tell it that the macro requires persistent CGI support.
To start a transaction:
Use one of the following methods in the macro before any output is sent to the Web browser:
The DTW_STATIC() function tells Net.Data that the current macro is persistent.
Syntax: @DTW_STATIC (["timeout"])
Where timeout is an optional parameter that specifies the number of seconds the Web server should wait for a response from the browser before ending the transaction.
Example:
@DTW_STATIC("60") %DEFINE { var1 = "val1" var2 = "val2" %} ... %HTML(input){ ... %} %HTML(report){ ... %}
A timeout value of 60 seconds is specified for this transaction. If a response is not received within 60 seconds from the browser, the Web server ends the transaction. This does not affect the current page on the browser. However, the next page, which would have been part of the transaction, is now part of a new transaction.
Syntax: %DEFINE(STATIC) var1 = "val1"
Example:
%DEFINE(STATIC) var1 = "val1" %DEFINE var2 = "val2" ... %HTML(input){ ... %} %HTML(report){ ... %}
A statically defined variable keeps its value throughout a transaction, which can span multiple Net.Data invocations.