home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!well!oster
- From: oster@well.sf.ca.us (David Phillip Oster)
- Subject: Re: Reading STR#
- Message-ID: <Bz8pox.CIz@well.sf.ca.us>
- Keywords: str# mac pascal c resource resedit
- Sender: news@well.sf.ca.us
- Organization: Whole Earth 'Lectronic Link
- References: <1992Dec13.211015.4725@dartvax.dartmouth.edu>
- Date: Mon, 14 Dec 1992 08:17:21 GMT
- Lines: 20
-
- In article <1992Dec13.211015.4725@dartvax.dartmouth.edu> smsilver@coos.dartmouth.edu (Scott M. Silver) writes:
- >I want to be able to get ones of a length bigger that 255...or somewhat
- >unlimited ast the case may be (<32k). I tried using GetIndString, but
- >that seems only to allow strings of up to 255 chars...Thanks in advance.
-
- A pascal string uses an unsigned byte as the length field, so it is inherently
- limited to 255 chars. For longer pieces of text, use a resource of type
- TEXT. TEXT is just a handle of characters, and it is what you get when
- you copy text from a text editor to the clipboard. To draw the text, do:
-
- VAR h : Handle;
- BEGIN
- h := GetResource('TEXT', 128); { or whatever the correct id # is }
- IF NIL <> h THEN BEGIN
- HLock(h);
- TextBox(h^, GetHandleSize(h), thePort^.portRect, teJustLeft);
- HUnlock(h);
- END;
- END;
- Please pardon any syntax errors, my pascal is rusty.
-