Wiki Home

Retrieve Error Line No Without Debug Info

Namespace: Wiki
I just discovered you can easily build your apps without debug info but with the possibility to capture the line numbers on which an error occured.

If you're like me, the need to capture the line numbers is higher than the disadvantage of having all the source code compiled into the EXE. I wondered why compiled PRGs (FPX) do not need the full source code to retrieve the line on which an error occured while forms and classes do.

When you try to blank the methods' fields of both classes and forms before building the application, it will result in the same effect as having the 'include debuginfo' unchecked: No line numbers available in an error event.

However if you replace all method fields with a '*' (I haven't tried it with another character yet) before you build your application, you've excluded all source code (ASCII source code and comments) but are able to retrieve the line number in case of an error event.

I tested this in the following manner:
  • I made a copy of my project files
  • In the copy: In all forms and claslibs, I replaced all methods fields with "*"
  • packed all forms and classlibs
  • build a executable with BUILD EXE MyExe FROM MyProject (of course without the RECOMPILE clause)
    The result: No source code in the executable, a significant smaller executable and still able to track line numbers in case of an event.

    So far, I did not note any side-effects. I'll hope this turns out to be a proper method to reduce the size of the executable. -- Walter Meester
    Category Tips And Tricks
  • ( Topic last updated: 2000.12.10 05:41:35 PM )