Hiding struct fields from call stack printer on error

Hiding struct fields from call stack printer on error

Anonymous
Not applicable
548 Views
3 Replies
Message 1 of 4

Hiding struct fields from call stack printer on error

Anonymous
Not applicable

Hi guys!

I've got a MAXScript tool that uses structs with inherited methods and other structs with their own methods...

 

And I've got a HUUGE problem: as a runtime error occurs, MAX tries to print the call stack, and it takes a VERY long time, like I'm just waiting near a half of hour to simply see the error text(I don't really need the call stack often, and I can store it manually if i wish to).

 

So, the questions're:

1) How can I "hide" struct members to make them not be printed, or can I kinda turn off call stack display? I know about "private" member definition, but it won't work in 3D MAX 9 SP 2, that I must support in my script.

 

2) How can I break the script execution? I mean like a result of an error throw - the script just stops all work and returns at the top level of the call stack.

0 Likes
549 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

In general not sure why would you need such huge structs. Maybe consider splitting it?

 

However, you can avoid printing stack info when you handle exception like:

try 
(
  filein "some_script.ms"
)
catch 
(
  format "*** % ***\n" (getCurrentException())
)

For stopping your maxscript at any point just call throw() (in your case it would be a good idea to handle it)

Hope it helps,

0 Likes
Message 3 of 4

Anonymous
Not applicable
My structs're splitted, but they inherit one another - that's why the original problem appears.

I know how to handle errors, and I'm very interested to see the call stack with parameters in the handler, but I can't(see the original problem).
0 Likes
Message 4 of 4

Anonymous
Not applicable

Well, in this case I suppose I can't help you.

I would recommend considering turning your tool (or parts) into C++ or C# plugin if you need such massive data structures.

Also you should gain some performance and powerful debugging tools.

0 Likes