Notifications
Clear all

[Closed] How to disable — Error occurred in anonymous codeblock ?

Hi guys,
I ‘ve made a little big script,almost done,but,when I encrypt it ,got errors,only shows in 2009,2010,
2011 or higher are perfect working,2009 or 2010 also works fine if do not encrypted,so I don’t know how to fix it ,this script has 19300 lines,I decide to disable the error messages ,but ,after using try catch() ,the message still shows,what shall I do now?thanks.

– Error occurred in anonymous codeblock; filename: D:\3ds Max 2009 est.mse; position: 1168866; line: 4538
>> MAXScript FileIn Exception: – Syntax error: at bad, expected <factor>
– In line: <<

5 Replies
 lo1

Show the line that’s failing?

2 Replies
(@momo2012)
Joined: 11 months ago

Posts: 0

thanks lo,
these are all the messages:

– Error occurred in main.pressed(); filename: D:\3ds Max 2010_EN\main.mse; position: 245; line: 1
– Defined in encrypted script
>> MAXScript Rollout Handler Exception: – ** interrupted **
<<

I last test the codes,divided them into pieces to debug,it may the try catch() function caused,like

try (deletefile (data_path+data_setting_name+test[81]+test[30]+test[23]+test[26])) catch()

when I changed to


try 
(
deletefile (data_path+data_setting_name+test[81]+test[30]+test[23]+test[26])
) 
catch()

would work fine for encrypt script.
but there are lots of try catch,most of them still cannot work,like:

try	
(
     (data_file_load() )
)
catch 
(
	(data_custom_array=#())
)

If I delete them or put them single,would no error messages,untill put them into the whole script.

(@momo2012)
Joined: 11 months ago

Posts: 0

I finally find the real reason,it’s the openEncryptedFile function,when an encrypt script open an encrypted file would miss something,so shows the messages.hope guys that have this problem can handle it next time like me.
this may the 2009 or 2010 bugs,I think 2011 or higher has fix it.

I am ready using my own encrypt script to handle it ,thanks lo

 lo1

The problem is a compile time error, not a run time error. Most likely you’re using a command which does not exist in max 2009/10. try/catch will not help you here as that can only catch runtime errors. Though if you don’t show us the actual code that’s failing, we can’t help you.

1 Reply
(@momo2012)
Joined: 11 months ago

Posts: 0

I removed the openEncryptedFile ,then works fine ,I am making own encrypt systems