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

FormDestroy

Destroys a form, that is removes it from the screen. Use this function (from an event) to close a form.

Syntax

FormDestroy(hForm)

hForm:

The form handle, returned from the FormNew() function. The form handle identifies the table where all data on the associated form is stored.

Return Value

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

Related Functions

FormNew

Example

/* Display message to the operator. If after 10 seconds the 
operator has not selected OK, then destroy the form. */
hForm=FormNew("Hello",4,20,0);
FormPrompt(1,1,"Something bad has happened");
FormButton(5,2,"OK",0,1);
FormRead(1);
! Wait 10 seconds.
Sleep(10);
IF FormActive(hForm) THEN
! Destroy form.
FormDestroy(hForm);
END

See Also

Form Functions