×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
It's really pretty simple. A type, a code, and up to 3 optional
parameters, all of which can be literals or expressions. The above
works. However, I'd like to encapsulate those further so users can call
them without the type and code, like so:
I'd like these three functions all to call LogData. Each of them
defaults the values that are not passed in. I know I can pass "special
values" for type and code, but for various reasons I'd really like to be
able to call without those parameters. This seemed like an easy thing
to do, but I ran into difficulties. Clearly I can't just call this way
from LogCode:
I wrote a new routine LogCommon that instead of the parameters accepts
pointers to the parameters along with (for belt and suspenders security)
passing the number of parameters. I only then used the actual number of
parameters that were passed, and ignore the others. Initial testing
looked good with the address of unpassed parameters being sent as *NULL.
Unfortunately, it turns out you can't get the address of a parameter
defined this way:
Has anybody else dealt with this? It's a common pattern in Java, and
I'd like to be as clean about it as possible as I start to build some
library functions.
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.