Article View: pilot.programmer.codewarrior
Article #48Re: getting the number of items in a resource
From: George Caswell
Date: Tue, 31 Jul 2001 23:13
Date: Tue, 31 Jul 2001 23:13
25 lines
2568 bytes
2568 bytes
On Tue, 31 Jul 2001, John Shehata wrote: > Hi, > > I am trying to get the number of items in a Str Resource that i have, but > have not been able to pull it off. Below is what i am using. I want to get > the number of items in DueDtAppInfoStr. > One. String resources contain one string. If you want more, use a string list resource. Of course, technically, you can store whatever you want in a string resource. If you do choose to pack multiple null-terminated strings in a single string resource, you can figure out how many are there by getting the size of the resource and counting the strings. Use MemHandleSize() to get the size of the resource, and then iterate through the locked resource (not going past the end) counting the null characters you find. Just keep in mind that this is non-standard. Use a string list resource - then you'll have a string count, and you'll be able to edit the list with other resource editors. ---GEC Projects page: http://home.maine.rr.com/tetsujin/ (M-x depeche-mode) "I am but the humble student, who hopes one day to snatch the resin-cast pebble from the master's fully articulated hand."
Technical Details
Message-ID:
<Pine.LNX.3.96.1010731191155.28419E-100000@adamant.homeworlds.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!cyclone.nyroc.rr.com!cyclone-out.nyroc.rr.com!typhoon.nyroc.rr.com.POSTED!not-for-mailReferences:
<CziK4pgGBHA.2152@server2.massena.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d41,61ff5c0e19189aeb X-Google-Attributes: gid109d41,public X-Google-Thread: 10baa0,61ff5c0e19189aeb X-Google-Attributes: gid10baa0,public X-Google-Thread: 10c638,61ff5c0e19189aeb X-Google-Attributes: gid10c638,public X-Google-ArrivalTime: 2001-07-31 16:14:36 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!cyclone.nyroc.rr.com!cyclone-out.nyroc.rr.com!typhoon.nyroc.rr.com.POSTED!not-for-mail Newsgroups: pilot.programmer.codewarrior,pilot.programmer,codewarrior.palm From: George Caswell <tetsujin@maine.rr.com> X-Sender: tetsujin@adamant.homeworlds.net Reply-To: tetsujin@users.sourceforge.net Subject: Re: getting the number of items in a resource In-Reply-To: <CziK4pgGBHA.2152@server2.massena.com> Message-ID: <Pine.LNX.3.96.1010731191155.28419E-100000@adamant.homeworlds.net> References: <CziK4pgGBHA.2152@server2.massena.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Lines: 26 Date: Tue, 31 Jul 2001 23:13:23 GMT NNTP-Posting-Host: 24.31.144.47 X-Complaints-To: abuse@maine.rr.com X-Trace: typhoon.nyroc.rr.com 996621203 24.31.144.47 (Tue, 31 Jul 2001 19:13:23 EDT) NNTP-Posting-Date: Tue, 31 Jul 2001 19:13:23 EDT Organization: Time Warner Road Runner - Portland ME