Tip on quick way to find current form's class library in Sage Pro

Sage Pro uses Formsets for all its MDI forms. When debugging if you want to
find out which classlibrary your form belongs to here is what you can do:
- Ensure the form you want to know is the currently selected one.
- Press Ctrl+F9 (ensure you are running from VFP and have SBTDUTIL=ON).
- In the command window give
       MESSAGEBOX( _screen.ActiveForm.Parent.ClassLibrary)
- It will show the class library the form belongs to.

Further, if you are now interested in seeing when a property changes in that
formset you can give
PUBLIC lo_FormSet
Lo_FormSet = _screen.ActiveForm.Parent

Then in the watch window you can use lo_FormSet.so_FS.sc_Sono (or whatever
property you want to track)
Note: If you use the PUBLIC lo_FormSet, you will not be able to close the
formset w/o releasing the variable. To do this, in the command window give
Release lo_formset before you try to close the form.

Regards,
- Sankaran Raman
804-364-2995
sankaran@saharti.com
www.saharti.com
http://saharti.blogspot.com/

Tip for exiting Pro when you get Close open windows and cannot close

This will work only if you have SBTDUTIL=ON in Windows Environment and running Pro from within VFP

If you are trying to exit Pro and have no form open and Sage Pro still gives “Close Open windows”, press Ctrl+F9 to go the command window and give

go_cop.in_controlcount = 0
RESUME
and now you will be exit Pro.

Sage Pro set focus

Sage Pro sets focus in these following ways in the MDI forms:
1. State object sc_StatechangeSetFocus: This is the normal way by which Sage Pro changes focus when user moves from one "state" aka mode to another. In the design time form, hold your mouse over a state object and then press Ctrl+Shift and then click and VFP will select the state object. In the property sheet look for this property. You can set this to the "registry" name of another object in the form.

2. State object m_StateChangeSetFocus: This method is used instead of the property when the focus needs to be set conditionally.

3. In the FS object code. Search for m_SetFocus() and you most likely will find your code.

If you are interested in learning how to Program with Sage Pro you can buy our DVD. See www.saharti.com for details.