PreviousNext…

Show ’n’ tell VIII: string lengths & Java

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 off
String thisBreaks = doc.getItemValueString(SOME_FIELD_NAME);
	
// Complete String, even if > 64KB
Item 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.

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";