| Discussion |
Remote Name: 18.104.22.168
(This is in reply to a Querier Forum posting of 2/7/01 and posting of 2/8/01 related to BTCrit, a custom Saver-based application.)
You should avoid negative sequence numbers in the metafile, because function + str(seq) is the main index ordering of interest, and this won't collate negative numbers properly. Also avoid overuse of low seq #s, because the convention that seems to work best is to reserve the lowest seq #s for the lowest classes, i.e. the foundation. Exceptions are sometimes warranted, though, as in my recent BTCrit optimization, where an early test determines whether to skip over most of the state restoration steps.
While the state-saving logic of your form's svm_save method is application-specific, its state restoration logic is totally generic. All Saver-based forms inherit the foundation svm_restore method, which calls the core UDF savrrest(this), which in turn calls m.savrob_arg.svp_commander.CMDRM_DoFunc(m.savrob_arg.svp_funcid, m.savrob_arg). I.e. the state restoration boils down to a call the Commander's CMDRM_DoFunc method, passing it the configuration's functionid plus a "user-defined" argument, which by convention is always an object reference to the Saver object itself.
A Saver-based object's svm_save method assembles the steps of a generic Commander pseudo-function that takes a single user-defined argument, m.cmdr_arg1. When the pseudo-function is later "called" in the course of state restoration, the value of m.cmdr_arg1 will be a reference to the object whose state is to be restored. Commander is totally generic. It is purely a matter of Saver's conventions that the Commander pseudo-functions it creates require an object reference argument.
I gave some more thought to your suggestion about introducing optional starting and ending sequence number arguments, but I chose what I think is a cleaner solution in my recent BTCrit optimization changes. The key was to support a GOTO mechanism for jumping directly to a given sequence #.