********** * This process involves: * Harvesting of the records in earth (including those records in c_awaiting_salvation (these are * records which previously existed in earth, but were moved to the other cursor for some reason, * such as when various processes are run against them from the DEATH() process, where upon entry * into the DEATH() process, already had their lBornAgain set to .T.). ***** * Note: Records without lBornAgain = .T. go into a different cursor after entering the DEATH() process. ***** SELECT *, .T. AS lGlorifiedBody, .T. AS lAccessToRiverOfLife, .T. AS lAccessToTreeOfLife, .T. AS lImmortal ; FROM earth ; WHERE lBornAgain = .T. ; UNION ; SELECT *, .T. AS lGlorifiedBody, .T. AS lAccessToRiverOfLife, .T. AS lAccessToTreeOfLife, .T. AS lImmortal ; FROM c_awaiting_salvation ; && Note: No explicit test for lBornAgain as the DEATH() process only populates with lBornAgain = .T. records. INTO CURSOR c_saved ********** * Purge original sources for all records now in c_saved. ***** USE IN c_awaiting_salvation DELETE ; FROM earth ; WHERE lBornAgain * Note: Right now, only (NOT lBornAgain) records remain in earth ********** * Augment the records in c_saved with the previously recorded data from their earthly works. * Note: Not every work will be joined, but only those flagged as being based upon God's instructions. * This will significantly whittle down the number of records included in the tally for many records in c_saved. ***** SELECT a.*, SUM(b.nReward) as nReward ; FROM c_saved a LEFT OUTER JOIN c:\heaven\recorded_earth_works.dbf b ON a.cName = b.cName ; WHERE b.lBasedOnGodsInstructions = .T. ; GROUP BY a.cName ; INTO CURSOR c_saved_plus_eternal_rewards * Right now, we have a cursor which identifies the sum total of the eternal reward for all in c_saved. * For some records this can be a large value. Others will be closer to 0. ********** * Populate Heaven with those new records ***** SELECT heaven APPEND FROM c_saved_plus_eternal_rewards USE IN c_saved_plus_eternal_rewards * Processing of harvested earth records is complete. * Note: There are many more columns in heaven than earth, and these will be populated appropriately. ********** * Note: It's hard-coded that various processes from goD must be executed against records in earth before continuing. ***** * This process iterates until gnGodsAnger reaches 0, which is determined externally, hence the global variable. * Note: The pour_out_wrath() method will spawn many sub-functions which each conduct various operations * against the earth table itself, as well as records in earth. By the time this process completes, much will have * been changed in earth, as well as the records within. Those records which do not make it through the process * will be moved to the c_awaiting_judgment cursor. ***** SELECT earth lnIteration = 1 DO WHILE gnGodsAnger > 0 goD.pour_out_wrath(lnIteration) && Will delete various records at each pass based on iteration lnIteration = lnIteration + 1 ENDDO * When we get here, very few records exist in earth, as most have been moved into c_awaiting_judgment. * The next process will take input from records in both sources: earth, c_awaiting_judgment. ********** * The program ends, and control is returned to master. * The next process, JUDGMENT(), begins. See REVELATION.PRG for step-by-step instructions. ***** RETURN TO MASTER