Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

Clear Form Syntax (OpenInsight Specific)

At 23 MAR 2000 01:38:07PM Bill Vaughn (Wildish) wrote:

I seem to be having a problem getting the right syntax to clear a form from a script. The term "ctrlclassID" I believe is my downfall. The documentation says "the window control type is the only valid entry, no examples are published. Unsure exactly what "window control type" meant I have tried the following:

clr=Clear(@window,"WINDOW",1,1,1)

and

clr=Clear(@window,"RECORD",1,1,1)

each time I get an "ERROR LOADING CLEAR PROGRAM".

other variations have failed also…. I know that I have the option of using SEND_EVENT(@window,'CLEAR',params) but I would really like to make the Clear statment work. Any help would be appreciated.


At 23 MAR 2000 02:10PM [email protected] wrote:

Bill,

I don't have my system handy so this is only off the top of my pointed head but ..

1) I do not believe there is a 'clear' command for clearing a form. If you saw this in the help file then .. sometimes the help is not as useful as it would seem.

2) Use the Send_Event. This is guarenteeded(sp?) to process the event chain .. which you want to have happen.

[email protected] onmouseover=window.status=imagine … opinions that seem to scare;return(true)"

David Tod Sigafoos ~ SigSolutions

cell: 503-341-2983


At 23 MAR 2000 02:18PM @window wrote:

call Send_Event(@window, "CLEAR", …)


At 23 MAR 2000 02:24PM Revelation Technical Support wrote:

Bill,

Found this info on a recent discussion thread.

Hope it helps.

If the controls on your form have database associations (you've specified a table and column for each control) then why not use:

SEND_EVENT( @WINDOW, 'WRITE' )

to save the record instead of opening the table and writing the record to @ID? Then clear the form by using:

SEND_EVENT( @WINDOW, 'CLEAR' )

If you need to clear the form without saving the changes and you don't want the user to get the save warning message use:

SEND_EVENT( @WINDOW, 'CLEAR', bSaveKey, bSuppressWarning, bMaintainFocus )

with bSuppressWarning=TRUE$. ( Refer to the CLEAR event in the OI Programmer's Reference manual for a description of the other CLEAR event parameters. )

Bill B.


At 23 MAR 2000 02:57PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

The documentation is slightly misreading on this.

The CLEAR event documented is the user routine that will be called when the window receives the CLEAR event from the system.

If you look in the window form designer, you'll be able to define code for the window's clear event. At the top of the screen, in the title bar, you'll see the function declaration. This is the same as what's listed in the manual.

Basically, the way this works is you SEND_EVENT( Window, "CLEAR").

Only way.

The Sprezzatura Group

World Leaders in all things RevSoft

View this thread on the forum...