ProcScript for Static Server Pages

Several ProcScript instructions are specific to web applications, and some other ProcScript instructions behave differently in web applications or are inapplicable.

ProcScript for USPs
ProcScript Instruction Explanation
reconnect Reconnects data loaded from an XML stream with the occurrences in a database or component. It can check whether a field is read-only, and if it is, ignores user modifications and restores the field value from the database. For more information, see reconnect.
webgen

Creates an HTML document from the USP definition as an HTTP response to an HTTP request. For more information, see webgen.

webget

Loads data from an HTML request into the current server page. Validates database fields. Activates the detail trigger of the submitted button if there is one. For more information, see webget.

$user

Returns the user name used to log on to the Web application. For more information, see $user.

$password

Return the password used to log on to the Web application. For more information, see $password.

$web

Checks if the current component was started in a Web context. For more information, see $web.

$webinfo

Accesses objects loaded from the HTTP request and all the Web server variables. For more information, see $webinfo.

When used with the authorization mechanism, $user and $password can be used at the application level for security checking. They can also be used in state management, for example, to identify state information stored in a file or in a database table.

In static server pages, webget, $webinfo, and webgen are used for processing each HTTP request. $webinfo must be used after webget, otherwise there are no objects to be retrieved. For more information, see Processing Requests and Responses for Static Server Pages.

ProcScript that Behaves Differently in Static Server Pages

ProcScript Instruction

Explanation

edit

Equivalent to a webget followed by a webgen. For more information, see edit.

fileload/web

Load files that are uploaded via the browser. For more information, see fileload.

putmess

Append the message in the message frame and write the message to the log file, if the assignment setting $PUTMESS_LOG_FILE is set. For more information, see putmess.

$fieldproperties

Apply style formatting to specific fields. For more information, see $fieldproperties.

$formtitle

Set the web page title displayed in the browser’s window title bar. For more information, see $formtitle.

$putmess

Insert the contents of the message frame into the HTML page. For more information, see $putmess.

$text

Insert a message into the HTML page. For more information, see $text.

ProcScript Inapplicable in Web Applications

The following types of ProcScript instruction are inapplicable to Web applications:

  • Instructions related to component types other than the server page. For example, $lines is only for report components, $gui and $interactive are only for client/server components.
  • Instructions that are specific to an object that is not supported in server pages. For example, $hide and $inlinemenu are menu-related instructions. Menus are not supported in server pages.
  • Instructions that require some interaction from the user or interactive context to process, such as askmess or $next.
ProcScript that is not Supported in Web Applications
ProcScript Instruction Explanation
askmess

Consider the following code:

askmess "Continue?", "Yes,No"
if($status = 1)
   webgen
else
   putmess "The user doesn’t want to continue."
endif

Before the askmess returns a value in $status, it needs a Yes or No answer from the user. However, the server page waits for the completion of the askmess before it generates a HTML page to the browser. Therefore, it is impossible to get the answer from the end user. The server page waits at this point until the process is terminated by time out.

$curhits Hitlists require a stateful client/server environment. To implement data paging in web applications, the retrieved dataset must have a fixed order, and each request sent to the server must specify where to start fetching the data. For more information, see Data Paging in Web Applications.
$dbocc Hitlists require a stateful client/server environment. If required, you can use the JavaScript API to get information about a specific occurrence. For more information, see getStatus() .
message Use webmessage instead. For more information, see webmessage.
$next $previous Need an interactive context such as the current occurrence. Such a context disappears when a button is clicked to submit the web page.

All other ProcScript instructions can be used in server pages. For example, all the controlling and calculating instructions, such as if, $sin, $date and so on, work in any type of application, including web applications.

Related Topics