a couple of days ago i noticed an increase of file size of my executables. After some further investigation i found out, that it seems that procedures are linked and compiled into the program file even if they are not referenced at all.
Here is a sample code to point out the problem:
Code: Select all
Procedure UnCalledProc()
If ExamineDirectory(0, GetHomeDirectory(), "")
While NextDirectoryEntry(0)
MessageRequester("Test", DirectoryEntryName(0))
Wend
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 400, 300, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
UnCalledProc()
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
If you now comment out the procedure call at line 10 (UnCalledProc()) and compile again, the size does not change and is still 55,1 KB.
If you then comment out the whole procedure block, the size reduces to 42,8 KB. This size i did expect when i commented out the procedure call.
In this sample piece of code the effect is very small, but in larger projects the file size increase much more, especially if you use just very less procedures from a big common module.
Best regards
Uwe