home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15305 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.9 KB  |  45 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!resnick
  3. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  4. Subject: Re: EditText items larger than 255 bytes?
  5. References: <BuAyG1.8n7@iat.holonet.net> <2AAE73AE.49F@intercon.com> <1992Sep10.200136.18513@tamsun.tamu.edu>
  6. Message-ID: <BuDs0G.35K@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Organization: University of Illinois at Urbana
  9. Date: Thu, 10 Sep 1992 21:07:25 GMT
  10. Lines: 33
  11.  
  12. bpb9204@tamsun.tamu.edu (Brent) writes:
  13.  
  14. >amanda@intercon.com (Amanda Walker) writes:
  15. >|
  16. >|Close.  TextEdit is limited to 32K, which puts a hard limit on the size of an 
  17. >|editable text item.  The key to getting more than 255 characters, however, is 
  18. >|simply to avoid using GetIText & SetIText, but to use GetDItem and SetDItem 
  19. >|directly, copying things into and out of thew handle yourself.
  20.  
  21. You can't do this!
  22.  
  23. >If you have a modal dialog box with 4 text areas, that's automatically
  24. >128k of RAM sucked up for 4x255 = 1020 bytes for actualy data (retrieved or
  25. >set via the SetIText/GetIText calls.  If you used the MacOS calls to
  26. >the letter, that's a 1020/128k percent utilization... pretty awful.
  27.  
  28. No, no, no. RTFM folks. IM I-408:
  29.  
  30.         Note: Actually, a single edit record is shared by all editText
  31.         items; ...
  32.  
  33. So, first of all, you can't look in the TextEdit record to see what's
  34. in it because you won't know where in that record the field you want
  35. is stored. Second of all, the hText field of the TextEdit record is a
  36. handle to the text which changes size as you add and delete text. It
  37. is not a static 32K of data.
  38.  
  39. pr
  40. -- 
  41. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  42. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  43. System manager - Cognitive Science Group, Beckman Institute, UIUC
  44. Internet: resnick@cogsci.uiuc.edu
  45.