Article View: comp.sys.mac.programmer.help
Article #20Re: Can an OSType be interchanged with a Str255? How?
From: Mark Sproul
Date: Wed, 30 Aug 1995 16:38
Date: Wed, 30 Aug 1995 16:38
32 lines
1222 bytes
1222 bytes
In article <oylerb-2108950006040001@msp1-5.nas.mr.net>,
oylerb@tdkt.skypoint.net (Bill A. Oyler) wrote:
> Hello,
>
> This should be a simple question. I need to change the creator of a file
> by using the SetFInfo toolbox call. The creator is stored in a Str255,
> however, not in an OSType like the call requires.
>
> How can I convert a Str255 to an OSType? I tried some different methods
> of typecasting, but can't get anything to work. Help! :)
OSType myType;
Str255 string;
long tempLong;
tempLong = string[1];
myType = tempLong << 24;
tempLong = string[2];
myType |= tempLong << 16;
tempLong = string[3];
myType |= tempLong << 8;
tempLong = string[4];
myType |= tempLong;
Mark
Technical Details
Message-ID:
<sproul-3008951238290001@marks.rd.ap.org>Path:
arc1-ca.pugleaf.net!marks.rd.ap.org!userReferences:
<oylerb-2108950006040001@msp1-5.nas.mr.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!marks.rd.ap.org!user From: sproul@eos.ap.org (Mark Sproul) Newsgroups: comp.sys.mac.programmer.help,comp.lang.c Subject: Re: Can an OSType be interchanged with a Str255? How? Date: Wed, 30 Aug 1995 12:38:29 -0400 Organization: Associated Press R&D Message-ID: <sproul-3008951238290001@marks.rd.ap.org> References: <oylerb-2108950006040001@msp1-5.nas.mr.net> NNTP-Posting-Host: 165.1.27.20