>define class oForm as form > autocenter=.T. > caption="Testing" > > procedure queryunload > clear event > endproc >enddefine >Cetin told you the right way to do this, and the reason why the above was the wrong way is in the way VFP uses .h files - it takes only #define and other # lines from it, and ignores any other lines there. It's only for precompiler directives; you can't have code there. And you don't need to have it there; with Set Procedure ... Additive, and class libraries, you have it all.