Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I output FourCharCode variable as text?



On Nov 27, 2003, at 1:41 AM, Tom Becker wrote:

Good point, but in MacRoman only the control characters are unprintable, so
a very simple test will at least produce something where you can tell what
it is:

void Print(FourCharCode id)
{
if (id >= 0x20202020)
printf("%.4s", (char*)&id);
else
printf("0x%08x", id);
}


I can break that!

Print(0x30004142);

would be rendered as "0".

I think we've shown that this is a complex problem. OTOH, there aren't THAT many ASCII codes to memorize, and if you're looking for a couple of _particular_ FourCharCode values, you can learn their hex representations...

Jim H
[who still remembers that 0x4E71 is a 68000 NOP instruction]
--
Jim Hamilton
512-699-3307

email@hidden
email@hidden
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How do I output FourCharCode variable as text? (From: Tom Becker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.