> Can you program procedures or something like procedures in forms? ....
Yes sure. Simply create a mehtod on the form. Than You can Call Thisform.Object.Value = ThisForm.MyMethod()
or something like that.
> Tired of changing the same code many times!
If You have similar behaviour in some or all of Your Buttons or other objects, this sounds like You should think about subclassing. If You always put something like
if ThisForm.QueryUnload()
ThisForm.Release
endif
in every button You use for closing a form, You should create a Close-Button ONCE! and use this instead of VFP's default button.