Friday, July 27, 2007

64k limit on "Print" in web agents

I knew there was a limit, but I didn't take the time to test it before today.

According to my tests, the limit is 65 534 characters per Print statement. When the string you're printing is above this, something strange happens.

I made an agent with a For .. To loop to concatenate a string. The string contains the counter and a line-break per loop.

String length: 65 193
Last line printed: 5100 (Correct, For 1 To 5100)

String length: 70 393:
Last line printed: 414 (Wrong)

String length: 78 193
Last line printed: 1059 (Wrong)

9 comments:

Julian Robichaux said...

Funny, I was just talking to someone about that the other day. There's actually an SPR for this in Domino 6.5.6 (#RMAS5RRLUW):

link

I was testing on a Domino 8 server, and the problem didn't seem to exist there, but who's using Domino 8 yet?
;-)

Tommy Valand said...

Ahh. Didn't know that. I figured it was just one of those strange (undocumented) Domino limits.

The server I ran the test on is v7.02.

Julian Robichaux said...

Well, technically I suppose it IS a strange, undocumented limit...
;-)

Rishi said...

Hey Tommy,regarding your comment on my blog(http://planetlotus.org/6a6c9c),
I see this could be the possible cause using Print(in bulk). However,Why does it fails when you use "NotesStream" class to print on the browser? Do you have any test on this ?

Tommy Valand said...

Since you you didn't show a screenshot of the code, I presumed you did a Print at the end of the agent.

On (at least) some versions of Domino, you'd have to split the string into 64k chunks, and print them chunk by chunk.

Rishi said...

You can see print shot in my blog here : http://planetlotus.org/6a6c9c

Actually, I'm surprise with "NotesStream" class behaviour.

Tommy Valand said...

There is no screenshot of the actual print statement. Only a couple of screenshots of string concatenation. One string + string, and one by using a NotesStream.

Rishi said...

Print is at the end of the agent.

Tommy Valand said...

Hence your problem.

..On (at least) some versions of Domino, you'd have to split the string into 64k chunks, and print them chunk by chunk..

Here's some old code I used to work around the limit.