Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unused routines still result in huge .EXE
#11
My way of dealing with huge routines is to wrap them inside precompiler blocks.


Code: (Select All)
$IF CENTER_TEXT_USED THEN
    SUB CenterText(x$, where)
       'centering routine
    END SUB
$END IF


Now, I can include that source in any other program of mine, for use basically as a library file, and it's NOT going to get added to the compiled EXE.  It's going to be skipped over and excluded by default.

IF I want to make use of that routine, I'd need to add one line to the top of my source:

Code: (Select All)
$LET CENTER_TEXT_USED = TRUE 

I've set my routines to be excluded by our built in precompiler, until we specifically specify to include them in our source.  This method ensures that ONLY the code I need is included in my EXE, making it as small as possible with QB64PE.
Reply


Messages In This Thread
RE: Unused routines still result in huge .EXE - by SMcNeill - 08-07-2024, 01:10 AM



Users browsing this thread: 2 Guest(s)