Re: Forms captions

gruntz@oberon.ch
Wed, 5 Jun 1996 17:04:29 +0200

> Hi,
>
> 1. What is the purpose of link to a caption in a form? I would like
> to design a form in which a caption is dynamic, taking its value
> from a string variable. Is that the purpose of a link to a
> a caption? I want a caption that cannot be manipulated by the
> user but that can be set by the program.
>
> Stan Warford
> Pepperdine University
> warford@pepperdine.edu
>

You can also add a Guard to the caption which sets the label. An example
is given in the example module below.

If you want to display a value to the user which he should not manipulate,
you can also use a field and set the read only guard. Note, that fields which
are bound to read-only variables are automatically read-only.

- Dominik

MODULE Test;
IMPORT Dialog, Strings;

VAR n: INTEGER;

PROCEDURE Guard*(VAR p: Dialog.Par);
BEGIN (* the label changes whenever the guard is called *)
INC(n); Strings.IntToString(n, p.string);
END Guard;

END Test.