home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 19768 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.3 KB  |  33 lines

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