http://www.newton-inc.com/dev/techinfo/qa/qa.htm
protoTXView
data stored in a soup entry, for example to get the text for sending in email?protoTXView
method GetRangeData
always allocates its storage from the NewtonScript heap, so you will need to copy the data into a destination VBO in chunks. Here's some code to do that. (This code uses a 4K block size, you may wish to adjust that as necessary, add error checking, etc.) StringFilter
is used to remove the protoTXView
graphic indicator. constant kChunkSize := 0x1000; // 4K chunks
local start := 0;
local theText := GetDefaultStore():NewVBO('string, length(""));
// make VBO into a proper string
BinaryMunger(theText,0,nil, "", 0, nil);
while numChars-start > kChunkSize do
// strip out graphics characters
StrMunger(theText,start, nil,
StringFilter(
textView:GetRangeData(
{
first: start,
last: start := start + kChunkSize
}, 'text),
"\u2206\u", 'rejectAll),
0, nil);
// copy remainder
if start < numChars then
StrMunger(theText,start,nil,
StringFilter(
textView:GetRangeData(
{first: start, last: numChars}, 'text),
"\u2206\u", 'rejectAll),
0, nil);
// theText now holds plain text from the protoTXView
For clarity, the code above does not use ClearVBOCache
as mentioned in the Q&A, "How to Avoid Resets When Using VBOs". If you are having problems with large VBOs during code like that mentioned above, see that Q&A for more information.