Layout of model documents

The set of layout suggestions below can be supported and easily maintained up to a certain level through the use of word processor options and functions in Microsoft Word (styles, indentation and hanging indentation). These layout suggestions are specifically designed to work together with the predefined ITP styles.

Layout suggestions
Word processor options

To enhance readability font colors can be added to a model document. A (non-official) standard is to use blue text for the ITP Code, red text for Comments and purple/pink text for include statements.

Because we are working in a word processor character properties such as size, boldface and italics can be used. We advise you to use the following conventions in order to maintain a readable document:

Boldface and a few points larger than other code:

Italics:

These word processor options are reflected in the ITP styles, except for the INTERACTS style.

Example

#
BEGIN
(* This is an example comment. *)
FUNC TEXT ex_func(
CONST NUMBER a;
CONST TEXT b )
DO
IF a < 19000000
THEN
BOOL continue
INTERACT "Error"
TEXTBLOCK "Date before 1900"
QUESTION "Do you want to continue?"
DFT(FALSE)
ANSWER continue
IF NOT continue
THEN STOP FI
ELSE
ASSIGN ex_func := date( a ) + text_fragment( b; 3; 5 )
FI
OD
NUMBER test
(*
What we see here is an example of a comment that does not fit a single line and is therefore split over more than one line.
*)
FORALL X0 IN EXP.Example
DO
ASSIGN test := X0.Field
IF X0.Other_field <> "" THEN ASSIGN test +:= other_field FI
OD
#
@( number( test; 2) )
@( ex_func( test; "hello" ) )
#
END
#