|
Gene, >The fastest way to get context count is specify MATCTX receiver length 8, >then subtract 96 from bytes needed, then divide by 32. Which is in essence what my program does, except it divides by 48 since I specified both the ptr and object name options. It really doesn't matter since neither of us provide room to materialize the entries (which is when it slows down). Two other differences: - I used the API wrapper instead of the MI builtin, because it will work at all security levels (ala last Nov's discussion of this) - The count you get from MATCTX includes one per database file member in addition to one per database file. My code also got that count so it could exclude it, making the count correspond better to what you'd see from doing a DSPLIB command. Perhaps the latter is the same difference as the two counts your MI shows. My routine also runs in a fraction of a second, which the demo program calculates and displays along with the object count. As noted in the MI manual under MATCTX, this method is actually only an approximation as it can be affected by a few factors. But in my experiments it was dead on in most cases, and real close in others. Doug +--- | This is the MI Programmers Mailing List! | To submit a new message, send your mail to MI400@midrange.com. | To subscribe to this list send email to MI400-SUB@midrange.com. | To unsubscribe from this list send email to MI400-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: dr2@cssas400.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.