write Instruction

The write instruction outputs the value of an expression to the Jade Interpreter Output Viewer window.

Syntax

The syntax of the write instruction is:

write expression;

The expression value can be of any type.

If you use the write instruction with an operand that is an object reference, the internal object identifier (oid) of that object is displayed.

Description

You can use the WriteEnabled parameter in the [JadeInterpreter] section of the JADE initialization file to disable the output of write instructions to the Jade Interpreter Output Viewer.

It is common to build up a formatted string expression to act as the operand of a write instruction. In order to build up a string using expressions of different types, you must use the .String string conversion operator in order to convert non-string operands to strings. For more details, see "Converting Primitive Types", earlier in this chapter.

For details about viewing the output from your executed method, see "Using the Jade Interpreter Output Viewer", in Chapter 1 of the JADE Runtime Application Guide.

Although server methods are prevented from executing code that requires Graphical User Interface (GUI) objects (for example, forms and controls), you can use the Jade Interpreter Output Viewer for write instructions in your JADE applications running on a server. The Interpreter Output Viewer is a separate module that talks directly to the operating system and does not require any GUI objects.

When JADE is running in thin client mode, the write instruction is always executed on the presentation client workstation.

Example

The following example shows the use of the write instruction.

writeDate(date: Date);
vars
begin
    write "The date today is " & date.format("dd.MM.yyyy");
end;

This example, executed on 18 June 2001, outputs the following to the Jade Interpreter Output Viewer.

The date today is 18.06.2001