IDEA crashing after the whole procedure run is completed
Forums
Hi All,
I need some advise where to look at to resolve the problem I am currently experiencing.
I created a code which is quite lenghty (around 1800 lines).The main sub calls 14 different functions (mainly summarization , extraction and export, but also appending fields and gap detection). There is only 1 main database which is always used by all of the fuctions (some other databases are created on the basis of the original DB but they are always closed before code moves to the next function).
When I run each function individually it works perfectly and when I run the whole code together it also works ok unitl the last function is performed and the message box is dispalyed that all funcions that have been executed. The problem starts when I press ok button on the MsgBox as the database seems to get frozed after and IDEA crashes displaying error message that is will be shut.
Did anyone experience anything similar? Any idea or suggestion where should I look for to narrow down the problem?
I am not able to provide the code due to company policy I built the code for (it wouldnt be practical anyway due to the lenght of it).
Any advise would be greatly appreciated.
Hi Pawelski_33,
Hi Pawelski_33,
Your script has 1800 lines. Does your script file size is more than 64 KB?
If yes, may be it is the source of your problem.
I ever read that IDEAScript file size must be not over than 64 KB.
But I forget where the link about that limitation.
Firdaus Sentosa.
Hi Firdaus,
Hi Firdaus,
Thanks for the info. Do you remember where you have read this as I have never heard about this limitation and I have several scripts that I run that are over the 64KB size along with being 4 or 5 thousand lines long. I am just wondering if that is true for the current version of IDEA or older versions.
Brian
Thank you Osaajah, its
Thank you Osaajah,
its interesting what you mentioned about file size as mine file size is actually 77KB...
However someone suggested to me to remove (modify) nested IF section which I had previously - I attached that code snippet - maybe you can spot some obvious error there.
Simplifying that bit (running funtion in static order one after each other) seems to have resolved the issue.
Hi Brian,
Hi Brian,
Actually it happened 4 years ago when my friend (with IDEA 9.2) told me that he got an error when the script more than 1500 lines. And the error was gone when he splitted the script into 2 scripts. A few month later, I read on somewhere that IDEA could only handle script up to 64 KB in size. But if you are able to run 4000 - 5000 lines without error, so I think the limitation was fixed.
Hi Brian,
Hi Brian,
To anwer your question by static order i mean checking whether some specific condition is met within IF statement and depending on the result of that check carry out (execute) or not a specific function rather than using nested if statement - please see below snippet from the code - hopefully it is a bit clearer now.
If UserChoice(2)="N/A" Or UserChoice(3)= "N/A" Then
function_tracker = function_tracker & CrLf & " Call AppendFields_CR_DR (MasterDb)', UserChoice())"
'Call AppendFields_CR_DR (MasterDb)
Else
End If
If UserChoice(4) <> "N/A" Then
function_tracker = function_tracker & CrLf & " Call Function Append_Period()"
' Call Append_Period(MasterDb)
Else
End If
This can be a tough one to
This can be a tough one to figure out and not always easy. Here are some things that might cause this problem:
- If you use dialogs is there items in there that you have removed but haven't removed the code. Syntax errors in the dialog can cause problem in different parts of the script and are usually hard to figure out, I know I have been there.
- Make sure all your objects are closed after using them, this could cause a problem.
- If you have been using the same file for testing of your script maybe delete the file and get a fresh copy and run the script. Sometimes the script during development might have done something strange to your file and it needs to be refreshed, I have seen that happen over the years.
Those are kind of the big ones to check out, especially as it is crashing IDEA at the end so I would start with looking at these ones.
Good luck with your hunt.
Brian