I routinely place constants in code resources, such as tables and data
blocks that I want literally formatted and quickly referenced. It's also
easy to create any kind of literal resource using the resource compiler.
Normally, however, I don't care about the data being visible while not
executing.
Your issues are that 1) you want the cpp to make a pass on it so the date
and time tokens get resolved, and 2) you want it to be 'in the clear' for
casual observation.
One way - define an inline function like the following, and reference it
somewhere in your code:
#define kIDTag "chrisbruner"
inline void asm PrvIDTag(void)
{
bra.s @1
dc.b "\n",kIDTag,__DATE__,__TIME__,"\n"
nop
nop
nop
@1:
}
It doesn't have to be executed, but it must be reachable (so it isn't
dead-stripped). In case it is executed, there is a branch over itself. The
NOPs are to help disassembly stay in sync. I'd reference it in a piece of
code that is rarely executed, but will not be optimized out. For example,
your version of RomVersionCompatible().
For M$DOS, the command 'grep -a "chrisbruner" yourapp.prc' will yield the
line that contains the tag.
--------------------
Jeff Loucks
Mobile 253-691-8812
-----Original Message-----
From: cbruner [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 2:56 PM
To: Palm Developer Forum
Subject: Re: Fixed string in code.
That's exactly the problem. I'm trying to check the compile date and time
from outside the code, so that the palm software can be kept in sync with
other software/data in our system. I need to be able to find the string
using other software and save it into a datafile, which can be verified by
the palm software later when it's running. That way updates can be sure that
they are running with the correct data.
My scheme was to originally have
_PDADATESTAMP
{
char Tag1[12];
char Date[50];
char Time[50];
};
_PDADATESTAMP pdaDateStamp = {"chrisbruner",__DATE__,__TIME__};
I find the tag fine, but the date and time are jumbled. Of course when the
palm software starts up it can see them just fine, which leads me to suspect
that the linker is compressing data, and the loader uncompresses when the
palm software starts. Normally a very nice feature, but in this case....
Chris Bruner
Compulife Software Inc.
==============================================
----- Original Message -----
From: "Borszczuk" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[email protected]>
Sent: Thursday, January 12, 2006 5:44 PM
Subject: Re: Fixed string in code.
> On Thursday 12 of January 2006 23:27 cbruner wrote:
>
>> You had me all excited, thinking that you had a solution for me. Turns
>> out
>> it
>> compresses that just as much. This can easily be tested by grep 2006
>> program.prc
>
> Can't you just call your app with own code that would return needed
> information to the caller? Shall work (unless you want to check that
> outside PalmOS)
>
> Regards,
> --
> "Daddy, what "Formatting drive C:" means?"...
>
> Marcin http://wfmh.org.pl/carlos/
>
> --
> For information on using the PalmSource Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/