TextEdit Limits
The most important TextEdit limit is that it is not a word processor. It is unacceptably slow with as few as 2000 to 4000 characters in a field. Long
before you run into any other limits, editing a field becomes a tiresome task.
TextEdit is sluggish because of how it stores information. Each time you type a character at the beginning of a field, TextEdit must recompute offsets for each line that follows your change.
If you want to stretch TextEdit to its limits despite these warnings, keep these facts in mind:
• The value of teLength must be under 32K. This limit means you must
have fewer than 32,767 characters in your TextEdit field. • The size of destRect must be under 32K. To find the size in regular
TextEdit, multiply nLines by lineHeight. To find the size in styled TextEdit, multiply nLines by the largest lhHeight value in the LHTable. For example, say you have 2400 lines of 12-point Chicago.
nLines is 2400 and lineHeight is 16, so destRect is 2400*16 or
38,400 bytes. That's well over the 32K limit.
If you use one TextEdit record for many different fields, be aware of this:
• There can be many more entries in the lineStarts array than there are lines
in the field. This is because TextEdit never decreases the size of the array. And when you add a line to the field, TextEdit expands the array without checking if it's already big enough.