If you have agents that print a large amount of HTML/XML (concatenating into a string), one workaround is to check the string-length frequently:
If Len(yourString) > safeNumber Then
yourString = ""
Where yourString is the string containing the HTML/XML/etc., and safeNumber is a number that is smaller than the 64k - the maximum amount of characters you can imagine is added per concatenation.
If there is A LOT (5000+) of string concatenation in the agent, I suggest using Julian Robichaux' StringBuffer class. You would have to add a getLength-method, to check the length of the buffer.
Something like this:
'in stringbuffer class
Public Function getLength() As Long
getLength = Len(buffer)
'in the printing agent
If bufferObject.getLength > safeNumber Then
The above If-statements .. > safeNumber .. should be put inside the loop that you use to concatenate the string. Thanks for making me aware of the bad "documentation", Thomas.
If you have a lot of different content you want to print, I'd suggest having one agent per content-type, and that the agents only contains method calls to their respective script libraries (which in turn can use other scriptlibs). Having 20+ agents in an application quickly gets messy (at least from my point of view).
In agent (untested code):
Dim s As New NotesSession
Dim action As Variant
action = Evaluate( |@UrlQueryString("action")|,_
'the evaluate above returns a text-list with one item
Select Case( action(0) )
Call report( s.DocumentContext )