Andrew Narunsky
asked on
Compling Lotusscript <form name>: LotusScript Error - Syntax Error
I was modifying a script library and the modifications appeared not to work (tested by putting a Messagebox "here" line in the code). So I decided to recompile to "force" the changes through. It went through the whole process and just at the end came up with the message "<form name>: LotusScript Error - Syntax Error". It allows you to click the form and click OK which opens up the form but does not indicate where the syntax error may be.
This is a form that has not been modified in a while, and is being used successfully without errors every day. I also don't remember any errors the last time it was modified and saved (otherwise they would have been fixed).
Is there a quick way to try identify where this syntax error may be on the form?
This is a form that has not been modified in a while, and is being used successfully without errors every day. I also don't remember any errors the last time it was modified and saved (otherwise they would have been fixed).
Is there a quick way to try identify where this syntax error may be on the form?
ASKER
Yes it works. I've tried a few things on the form and selected 'Continue' each time debugger window appears. No errors reported anywhere. Am I doing this correctly?
Hum,
If you use Step Into you will see all steps even the libraries...
If you use Step Into you will see all steps even the libraries...
ASKER
I assume Step into goes through every line of code. If I do this will it report a syntax error if it comes across one? If I have to do this it's going to take ages as there's a fair bit of code.
If compilation fails, there's no point in using the Debugger... because the Debugger only runs on correctly compiled code.
Which Notes version do you use? You're right, it's sometimes very hard to find out where a particular error is. What happens when you open said form, and you change something (e.g. add a space) in the code and save the form, does it compile correctly? Even the Compile all LotusScript action can go wrong sometimes. If it compiles correctly, don't worry and use the database.
Some reasons for (almost) invisible compilation errors:
- %include files that do not exist
- a Use statement to a library that cannot be compiled (because you don't have the code)
- a button written in LotusScript that's hard to find
Which Notes version do you use? You're right, it's sometimes very hard to find out where a particular error is. What happens when you open said form, and you change something (e.g. add a space) in the code and save the form, does it compile correctly? Even the Compile all LotusScript action can go wrong sometimes. If it compiles correctly, don't worry and use the database.
Some reasons for (almost) invisible compilation errors:
- %include files that do not exist
- a Use statement to a library that cannot be compiled (because you don't have the code)
- a button written in LotusScript that's hard to find
ASKER
Interesting you mention that the Debugger only runs on correctly compiled code, as when I ran the debugger it all seemed to work. This form, associated buttons/functions, are operated on daily without any problems so this is a mystery.
Using version 8.5.2. As you suggested I added a line into the code (Messagebox "1"), recompiled, but same result.
The database is continued to be used (quite an integral database for us).
I thought I might print the source to see if I can spot anything obvious and turns out to be over 30 pages, so not sure I'll be doing that anytime soon, but I'll do a search for %include and Use to see if any are referencing non existing components.
Using version 8.5.2. As you suggested I added a line into the code (Messagebox "1"), recompiled, but same result.
The database is continued to be used (quite an integral database for us).
I thought I might print the source to see if I can spot anything obvious and turns out to be over 30 pages, so not sure I'll be doing that anytime soon, but I'll do a search for %include and Use to see if any are referencing non existing components.
There isn't the slightest hint as to where the compilation fails? Can you take a screen shot maybe, of a full compilation, and post it here?
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And sometimes it helped me to add a space inside the Use statement, or just comment it out and back in again, so the Designer thinks it has new code to compile. That might trigger the Designer to recompile ALL code in the form, including the libraries.
ASKER
I did as you suggested above, i.e. put in space in code and saved. It allowed me to. Recompiled - same problem. Then I put space in Use statement, saved and recompiled - same error (can't comment out Use statement as then form won't save due to error of somewhere else calling function in Script Library). So took comment out, saved and recompiled. No luck.
So it looks like the end result due to lack of anything else is perhaps what you said above "i.e. bug in Recompile All". Are you happy for me to mark this as solution?
So it looks like the end result due to lack of anything else is perhaps what you said above "i.e. bug in Recompile All". Are you happy for me to mark this as solution?
There's no need to recompile when the form is saved successfully.
ASKER
Putting this down to bug in Recompile All Script
Thanks :)
If you enable the Debug LotusScript, does the Debugger Lotusscript work, to trace the code?