I uploaded
PowerPac v15.531.0 and it basically completes the
caretPosition() function with the ability to set position AND insert text/HTML at the same time. In the future, I will look into automatic text selection as it is pretty easy to incorporate in with the work that was done thus far.
This version also does a more predictable job of handling carriage returns in HTML and text that is set in XML files. HTML content is handled so that extraneous spaces and carriage returns are removed. If you want a carriage return in the installed HTML, then use
<br> tags. When working with text blocks, something similar was done. If you need a hard carriage return, the use
\cr in your text and it will be converted to a hard return when installed.
<text>
<![CDATA[
This is some text that want installed in a field on the page.\cr
However, this line should be preceded by a carriage return.
]]>
</text>
<html>
<![CDATA[
This is some HTML that I want install in a field on the page. It has to contain <span class="spTag">special tags</span><br>
This line is preceded by a HTML newline character.
It will be properly installed by the PowerPac XML Engine. This line will flow naturally from the previous one since it was not
preceded by the <br> tag or other HTML formatting.
]]>
</html>
Note that when using
pgTBObjSet(), the hard carriage return is handled in the same way as in the XML Engine. Just use a
\cr when you need a carriage return in the text. Of course,
pgTBObjSet() is generally only used when manipulating small snippets of text, whereas the
XML Engine can handle any amount of text efficiently.
Clifton