General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › size limit of DocumentProperty
-
achu July 13, 2010 at 10:04 pm
size limit of DocumentProperty
July 13, 2010 at 10:04 pmParticipants 1Replies 2Last Activity 12 years, 8 months agoIs it possible to assign a very big string to the DocumentProperty? what's the size limit of DocumentProperty?
I try to pass data from IE at the resource manager back to XMetal.
Derek Read July 13, 2010 at 11:13 pm
Reply to: size limit of DocumentProperty
July 13, 2010 at 11:13 pmAll I can say at this point is that in theory there should be no limit. How big is your string?
A quick stress test in XMetaL Author 6.0 shows that a million characters is not an issue. It might take quite a while to build the string (the pure JScript looping part).
[code]// XMetaL Script Language JScript:
var curDoc, curDocProps;
curDoc=Application.ActiveDocument;
curDocProps=curDoc.CustomDocumentProperties;
bigStr = “”;
for (i=0;i<100000;i++) {
bigStr += “1234567890”;
}
Application.Alert(“bigstr.length = ” + bigStr.length);
curDocProps.Add(“cdpropsBigStr”, bigStr);
var s = curDocProps.item(“cdpropsBigStr”).value;
Application.Alert(“cdpropsBigStr.length = ” + s.length);[/code]If you increase the number of iterations (or increase the string that is being added) you can easily test bigger values. Note that this is a very inefficient way to build a string in JScript so it will take exponentially longer the more times you iterate through, but it is an easy way to stress the system. So, if you have a large text file on disk you might use Application.FileToString to read it in instead.
Derek Read July 14, 2010 at 1:26 am
Reply to: size limit of DocumentProperty
July 14, 2010 at 1:26 amOfficial word from our dev team is that the string size is only limited by the available application-heap memory at the time of the operation.
What is the limit you are seeing in your case?
-
AuthorPosts
- You must be logged in to reply to this topic.