Music Systems – Welcome
Introduction
This code manages…
frmPilgrims.NewPilgrims
When the op selects a pilgrim row from the selection grid on Tab 1, this method manages setting up the tabs/pages so that the data from any previously-processed pilgrim is cleared out
…Page2-cntDEpilgrims.SavePilgrims
Op clicks Save -> SaveAction method -> Save Pilgrims (this)
it manages the save only to hPilgrims.
…Page2.cntDEpilgrims.RefreshPilgrims
If the op changes one or more fields on the form, then clicks Cancel. This refreshes the screen with the original values, thus implementing the Cancel.
…Page2.cntDEpilgrims.SaveCarry
There is a SaveCarry method on each of Tabs 2,3,4. After a successful Save, this method retains some of the data from the Saved row that can be pre-filled into the fields of the new Add Pilgrim row IF and only IF op Right Clicks the Add Pilgrim button.
…Page2.cntDEpilgrims.ClearCarry
Once op does an Add Pilgrim procedure without Right Clciking the Add Pilgrim button we clear out the retained address and contact into using this method. There is similar logic in a method of the same name on Tabs 3 and 4 as well.
…Page2.cntDEpilgrims.CancelPilgrims
This cleans up after a failed Add or Edit (a Save). Extremely rare that this will be run, but that’s programming–cover all the possibilities.
…Page2.cntDEpilgrims.ClearCursor
This is called for each Tab 2 through 5 when a new pilgrim has been selected by the op.
…Page2.cntDEpilgrims.RetrievePilgrims
The op fills in some selection fields on page 1 and clicks Apply. Apply.Click calls this method to do the actual search for one or more pilgrims fitting the given specs.
…Page2.cntDEpilgrims.DuplicateCheck
I think this method is obsolete. Can’t find any code that call it any more…Safe to ignore.
…Page2.cntDEpilgrims.FlagChange
Every field that user can edit on the page (in this case Tab 2) has an InteractiveChange method that calls this method to force us into Edit mode, which makes the Save and Cancel buttons appear
…page2.ctrDEpilgrims.txtbirthdate.Valid
Show age but don’t save it.
…page2.ctrDEpilgrims.cmdmedical.Click
This prompts for the optional medical notes with (private) medical problems that registration needs to know about e.g. “uses a wheelchair”
…page2.ctrDEpilgrims.cmdhousekeeping.Click
Similar to Medical Notes. These are Housekeeping Notes–special needs that Housekeeping staff need to be informed about. Huware opens a popup form that allows a lot of data to be entered
…page2.ctrDEpilgrims.cmdregnotes.Click
Registration notes, also entered into a popup window.
…page2.ctrDEpilgrims.chkcform.Valid
The C-form is required by the government for all foreign pilgrims visiting Meherabad. Country of residence is not a valid indication of Indian or Foreign status. A European couple might have an India residence address. A Indian citizen might have an American address.
Introduction
This code manages saving pilgrim information to the hPilgrims table via the savepilgrims method. Also keeps track of carry-over data for pilgrims, keeping the curPilgrims result set temp table fresh, notes whether the current field values are obsolete (if a different pilgrim has been selected on Tab1 or the Ad Pilgrim button has been clicked on Tab1.
frmPilgrims.grdNav.Click
This is a simple override so that a single click of a row on the pilgrim selection grid on Tab 1 results in selecting that pilgrim
frmPilgrims.grdNav.SelectionMade
This is fired by the method above to check whether a real selection was made. If the Pilgrim’s primary key has not changed it isn’t really a selection.
frmPilgrims.grdNav.allownavigation
Prevent shifting to (selecting) a different pilgrim if the currently-selected one has a Save or Cancel pending
frmPilgrims.[method name]
Comments
Actual code
frmPilgrims.NewPilgrims
Prep for a new pilgrim selection, See the comments.
frmPilgrims.crtDEpilgrims.savepilgrims
Save just the info from Tab2 as a new or updated pilgrim.
frmPilgrims.CancelPilgrims
Cleanup after op clicked Cancel
frmPilgrims.ctrDEpilgrims.SaveCarry
There is a method with identical logic in each Tab container,. This one saves information from the Pilgrims row.
frmPilgrims.ctrDEpilgrims.refreshpilgrims
See Comments below–
frmPilgrims.Pgfpagerefresh1.commonpageactivate
This runs any time any page (i.e. Tab) is selected
frmPilgrims.Page1.Activate
This method runs whenever the Tab 1 is clicked on (activated). IF the form was called with the PM_ID supplied as a parameter, we want to go to the Visits page directly without making the user do it.
frmPilgrims.Pgfpagerefresh1.enabledisable
Running the NODEFAULT command causes this code to run instead of the standard class library code to run. This prevents pages from being disabled falsely.
frmPilgrims.grdNav.setcustomizableresortbehaviors
During start-up configure the grid for clicking the Headers of some columns to allow sorting on those columns in descending order.
frmPilgrims.grdNav.setcolumncontrolsources
When the navigation grid is being instantiated this method connects the curPilgrims result set with the grid columns.
frmPilgrims.grdNav.setindextaginfo
Fill in the column headers during startup.
frmPilgrims.ClearCursor
Empty the curPilgrims result set local table.
frmPilgrims.RetrievePilgrims
Outside of VFP you’ll probably have to handle this quite differently. Here we are working withing the curPilgrims result set temp table. You may be using some other way of managing a result set.
frmPilgrims.DuplicateCheck
Detect suspected dupicate(s) before doing an Add operation for a new pilgrim. Very helpful.
Introduction
These methods are associated with the FORM instead of being placed on the container objects (5 of them) that reside on the Tabs (VFP says Pages) of the Tab control of the form. There is a giant amount of code in the complete Pilgrims form. We are dividing all the code of the Pilgrims form into 7 popups of which this is the (main) one for the form itself. Then there are 5 popups for the code on the 5 Tabs plus one popup for the methods that are needed to perform a Save. These are spread across the main form and the Tabs of the form, so we published them together for ease of reading.
frmPilgrims.PageActivate
This gets executed every time the op moves from one Tab of the form to another. Complex and important.
frmPilgrims.SaveAction
Called to be the general manager of performing a Save. With 4 tables in parent-child relationships there is a lot of (critical!) detail to manage.
frmPilgrims.SaveAfterSuccess
Called when the Save has completed successfully.
frmPilgrims.SaveAfterFailure
Comments
frmPilgrims.CancelAfterSuccess
Called when the op has clicked the Cancel button and the Cancel has worked.
frmPilgrims.PilgrimReset
Comments
frmPilgrims.Load
Called as the form is being created, first thing before objects are instantiated. We use this to create internal tables (using the built-in file systems of VFP) that will be used as result sets to populates= grids, lists and combo boxes.
To do a rewrite of Huware the new author(s) will need to work out how to save and use result sets from queries, since most modern languages have their own ways of presenting result sets to the programmer.
frmPilgrims.Init
The class library we use with VFP provides an Init method that fires after the Load method. In Load the various objects for the form have not been instantiated yet and in Init those objects exist and can be manipulated. The class library also provides a ShellAdditionalInit method which fires at the end of Init and is used by the programmer to add additional action to those provided by Init.
Here we had to subclass Init because we need to add parameters 4 and 5 for the optional PM_ID of one pilgrim and the option to make the form modal. Usually this PM_ID is left blank. See below the DODEFAULT() call. That causes the INIT code of the class library also to be executed in addition to our code here.
frmPilgrims.ShellAdditionalInit
This is run by the VFP class library at the succesful return from the INIT method (above here). By this time the objects of the form like Tabs and grids exist and can be adjusted for startup.
frmPilgrims.Destroy
This method is fired by the class library when the user closed the form. A chance to clean up.
frmPilgrims.SetMode
The form keeps track of what mode it is in. Of the options modes that are supported by our class library only 2 are used in frmPilgrims:
‘D’ = default mode, no Save or Cancel are pending
‘E’ – Edit mode in which an Add or an Edit is required.
The InteractiveChange method of just about every textbox, combo box,optionbuttongroup etc on the 5 Tabs fires when the op makes a change, and that method calls thisform.SetMode to go into Edit mode, which turns on the Visible property of the Save and Cancel buttons. When a Save or Cancel are completed this method is called to go back into Default mode, making Save and Cancel invisible.
PROCEDURE setmode
frmPilgrims.createparamblocks
Creates 4 objects during startup that are used to retain pilgrim data that can be carried forward for the data entry of a group of pilgrims. If a family needs reservations and the op right clicks the Add Pilgrim button for each family member, then their address information other typically matching data can be applied without extra data entry to all the members.
frmPilgrims.FixQuote
This method is also in the Save group of methods. Simply tirns one single quote in a text field into a pair of single quotes, for SQL syntax.
frmPilgrims.UpdateFormOnEdit
Called from the class library. The stock behaviour of UpdateForOnEdit run because of the first line of code “RETURN DODEFAULT()” and the rest is left in for background information. You can just ignore it!
frmPilgrims.ActionButtonRefreshLogic
You can just ignore this since it just amounts to managing or “faking out” the class library expectations. You would not reproduce this in your rewrite.
Introduction
This code manages…
…Page3.cntDEvisits.FindVisits
Called when a new pilgrim is selected. Since the option button group control on Tab 3 defaults to Current Season, then unless op has changed it this method will populate the curVisits result set with any Visits from the current season, which as of 2026 starts on 1 may 2026.
…Page3.cntDEvisits.NewVisits
This method prepares for a new pilgrim, when one has been selected OR when one clicks Clear on Tab 1.
…Page3.cntDEvisits.SaveVisits
Called by Saveaction to do Insert or Update to hVisits during a global Save
…Page3.cntDEvisits.CurrentVisits
Fills the curVisits result set so that Tab 3 will be up to date before the user clicks it
…Page3.cntDEvisits.DeleteVisits
Called from the Delete button on Page 3. This is complicated of course because of handling child rows, because the pilgrim whose visit is to be deleted may be in a group, and to prevent a Delete if the op has already modified some Visits data for the current Visit. “Come on op, do you want to update or delete? If you want to delete then Cancel your changes first, THEN delete.” This is an exception to the principle that we defer all SQL server operations until Save or Cancel is clicked. This takes place AS the Delete Visit button is clicked (after the user confirms).
…Page3.cntDEvisits.CancelVisits
When the op clicks Cancel the cnacelaction callls this method to handle ust the Visits resetting process. Separately calls CancelBookings and CancelRoom.
…Page3.cntDEvisits.CheckVisits
See checkvt method below
…Page3.cntDEvisits.cmdCheckVT.Click
Before we allow a Visits row to be saved we do this integrity check. This is called directly by clicking CheckVisits on the page but also (much more often) from SaveVisits which you can read above.
…Page3.cntDEvisits.SaveCarry
There is a SaveCarry for Tabs 2,3,4. It retains fields that we will auto-fill for the next Add Pilgrim only if the op uses a Right Click on the Add Pilgrim next. Used often. Improves accuracy.
…Page3.cntDEvisits.ClearCarry
Similar logic on tabs 2 and 4. Once the op Left Clicks Add Pilgrim old retained data is cleared out for safety.
…Page3.cntDEvisits.ClearCursor
Empty out the curVisits result set on a change to a new pilgrim or an Add Visit
…Page3.cntDEvisits.BeforeRowColChange
Manage moving around in the Visits navigation grid on Tab 3. Handles the case that op is trying to go to a different Visit while changes to the current Visit have not yet been saved.
…Page3.cntDEvisits.AllowNavigation
Comments
…Page3.cntDEvisits.SelectionMade
Runs when user has clicked a Visit on the Tab 3 navigation grid.
…Page3.cntDEvisits.grdnav.Click
Treats a single click in the navigation gris as a selection (no double click needed)
…Page3.cntDEvisits.grdnav.setcolumncontrolsources
On startup sets up the navigation grid’s properties
…Page3.cntDEvisits.SetCaption
On Tab 3 this adjusts the caption giving pilgrim name
…Page3.cntDEvisits.cmdAddVisit.Click
op clicked the Add Visit button. NOTE Also see the next method which is how we do things a bit differently if the op RIGHT clicks the Add Visit button.
…Page3.cntDEvisits.cmdAddVisit.RIGHTClick
Do the usual Click processing but then also manage the retained info for the new Visit.
…Page3.cntDEvisits.cmdMembers.Click
Shows the members of a Group that is selected in the group combo box on Tab 3.
…Page3.cntDEvisits.cmdRomNotes
Opens an edit box popup form to receive optional notes about roommate requests
…Page3.cntDEvisits.opgScope.InteractiveChange
Handles op changing the Scope, usually set to Season Visits, but may be changed to Current Visits (only pilgrims whose visit contains today’s date or All Visits which shows Visit history incl previous season.
…Page3.cntDEvisits.cmdGroups
Comments
…page3.ctrDEVisits.grdNav.Click
Repeated from Tab3.Methods popup. Makes grdNav respond to a single click
…page3.ctrDEVisits.txtUltstart.InteractiveChange
See comments below
…page3.ctrDEVisits.cboFacility.CustomValid
Get set up when op selects a different Facility from the cboFacil combo box on Tab 3.
…page3.ctrDEVisits.cboFacility.Click
Get set up when op selects a different Facility from the cboFacil combo box on Tab 3. Part 1 of 2 (see the CustomValid method above.
…page3.ctrDEVisits.cmdDeleteVisit.Click
Simple way of handling Delete button. See the methods that do the actual work in the Tab3.Methods popup