Pages: 1
Print
Author Topic: size limit of DocumentProperty  (Read 2860 times)
achu
Member

Posts: 43


« on: July 13, 2010, 04:04:06 PM »

Is 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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: July 13, 2010, 05:13:32 PM »

All 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);

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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: July 13, 2010, 07:26:06 PM »

Official 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?
Logged
Pages: 1
Print
Jump to:  

email us