Using Statements and Commands in a NaturalX Server Environment

#### Search Results

Search

# Using Statements and Commands in a NaturalX Server Environment

The behavior of some Natural statements and Natural system commands changes in a server environment.

This document covers the following topics:

- Natural Statements

- Natural System Commands

## Natural Statements

This section covers the following statements:

- DISPLAY, INPUT, PRINT, REINPUT and WRITE Statements

- WRITE WORK FILE and READ WORK FILE Statements

- STOP and TERMINATE Statements

### DISPLAY, INPUT, PRINT, REINPUT and WRITE Statements

- Output to a screen (output to Report 0) is not appropriate in a server environment, and in some cases is not possible. Therefore, in the case of an interactive I/O in the server environment, the error NAT0723 is returned to the client. Redirecting the I/O by using the `MAINPR` parameter is, of course, possible and is fully supported.

- When output is written to a report by a method, the report is opened at the start of the method and closed at the end. The report is not kept open between method calls to avoid interference between clients.

### WRITE WORK FILE and READ WORK FILE Statements

When you access a work file in a method, the file is opened at the start of the method and closed at the end. The file is not kept open between method calls to avoid interference between clients.

### STOP and TERMINATE Statements

- The behavior of the `TERMINATE` statement matches that of the `STOP` statement. Processing of return values is not supported.

- The `STOP` and `TERMINATE` statements behave in the same way as the `ESCAPE ROUTINE` statement during method execution. Method execution is terminated immediately without producing any return value.

## Natural System Commands

Only the following Natural commands are allowed in the server environment:

- `CATALOG`

- `CLEAR`

- `EXECUTE`

- `LOGOFF`

- `LOGON`

- `READ`

- `RETURN`

- `RUN`

- `SAVE`

- `SETUP`

- `STOW`

From this list, the commands `CATALOG`, `CLEAR`, `READ`, `RUN`, `SAVE` and `STOW` are only allowed if the server is running under a development Natural (natural.exe).

All commands that are not allowed will be rejected with the error NAT0082.

### On this page

- Natural Statements
- Natural System Commands