Cicode Programming Reference > Cicode Function Categories > Form Functions Introduction > FormRead

FormRead

Displays the current form (created with the FormNew() function), with all the fields that were added (with the form field functions).

You can display the form and wait for the user to finish entering data by setting the Mode to 0. This mode is the most commonly used, with [OK] and [Cancel] buttons to either save or discard operator entries and to close the form.

To display the form and return before the user has finished, use Mode 1. This mode is used to animate the data on the form or to perform more complex operations.

This function is a blocking function. It will block the calling Cicode task until the operation is complete.

Syntax

FormRead(Mode)

Mode:

Mode of the form:

0 - Wait for the user.

1 - Do not wait for the user.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

FormNew

Example

! Display the form and wait for the user.
FormRead(0);
! Display the form and do not wait for the user.
FormRead(1);
! While the form is displayed, update the time every second.
WHILE FormActive(hForm) DO
FormSetText(hForm,hField,Time());
Sleep(1);
END

See Also

Form Functions