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.
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
call Send_Event(@window, "CLEAR", …)
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.
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.
World Leaders in all things RevSoft