Show ’n’ tell VIII: string lengths & Java 27 Apr 2006
Whilst clearing out my “to post” folder, I found this snippet, and figured it to be an ideal candidate for SnTT. Hopefully some follicles will be saved as a result of this posting.
As the actress said to the bishop, it’s all about length. String lengths to be precise. If you’re extracting text from a field, there’s a cut-off in Notes, both in Lotusscript and in Java. You may find that some limits are documented in Domino Designer Help (indeed, for all I know, this specific tip could be in the help too, but a cursory check just now drew a blank). Put bluntly, there’s a right way and a wrong way to extract the complete content of a field full of text in excess of 32KB - 64KB. Here’s how you do it:
// Won't work; cuts offString thisBreaks = doc.getItemValueString(SOME_FIELD_NAME);// Complete String, even if > 64KBItem itm = doc.getFirstItem(SOME_FIELD_NAME); String thisWorks = itm.getValueString();
Useful? I should cocoa!
Note: for tips on strings in Lotusscript, search Designer help for a document entitled Limits on string data representation in LotusScript.