[Closed] Excuting a very long string Bug/hack?
I have an issue where im executing a very long string.
i have stored the string in the user defined properties and to change it back to an array i need to use “execute”…
However because the string is very long it gives the following error…
“>> MAXScript Rollout Handler Exception: – Unknown system exception <<”
- How can I find a hack/fix for this?
- Is there a better way to store these?
Would it be easier to split the string into an array with filterString? I try to avoid using execute at all costs.
hrmm, as i am storing an array within an array, how would i use filterstring to filter this?
t = “#(#(1, 2), #(2, 2), #(3, 2))”
A bit convoluted I guess, but you can do it like this:
t = "#(#(1,2),#(2,2),#(3,2))"
newArray = #()
arrayIdx = 0
baseString = filterString t "# ( )"
aC = baseString.count
for i = 1 to aC do
(
if baseString[i] != "," then
(
arrayIdx += 1
newArray[arrayIdx] = filterString baseString[i] ","
for i = 1 to newArray[arrayIdx].count do
(
numeral = (i as integer)
newArray[arrayIdx][i] = numeral
)
)
)
print newArray
hrmm maybe it just max running out of memory
i get the same error with some code similar to the one you have there…
“>> MAXScript Rollout Handler Exception: – Unknown system exception <<”
sad
Could you post your code and the string? I’ll see if I get the same results.
–Store data
(
local MyArray
struct myData
(
name,age,race
)
append MyArray (myData name:“John” age:24 race:“X”)
)
–Geting data
MyArray[1].name
MyArray[1].age
ect…
Rene
ok i got it working putting a GC in the main loop. It was running out of memory, the string was over 500,000 chars long! Is there a better place to store arrays in an object?
Can I ask why you’re storing such a huge amount of data in an object in the first place?
im storing data needed for untriangulation. Some of the scripts need to triangulate the mesh, however working with trimeshes is painfull, so its usefull to keep an this data…