| Discussion |
Keywords: Querier, Suggestion
Remote Name: 184.108.40.206
I think the simplest, cleanest solution would be for you to use something like the following:
initexp = "docmd([publ qxprevdec], [qxprevdec = set('deci')], [set deci to 0])"
cleanupexp = "docmd([set deci to m.qxprevdec])"
I.e. my suggestion is that you should, in fact, make use of PUBLIC in this situation. Since your application is not generic, and there are no recursion/reentrancy issues, prejudice against using PUBLIC variables seems unwarranted. Practically speaking, there is no danger in making appropriate use of PUBLIC variables here, especially if you are reasonably careful about naming conventions and documentation.
You could instead use a reserved PRIVATE memory variable that is initialized in the wrapper or elsewhere up the stack, but that doesn't strike me as being either cleaner or simpler. I suppose the cleanest approach would be to introduce a new Querier metafile field for the SET DECIMALS expression to associate with the query definition, but this would require some Querier programming changes. (Let me know if you think such an extension is worthwhile.) Also note that one would generally want to use SET FIXED ON in conjunction with SET DECIMALS.