Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7925019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:04:59+00:00 2026-06-03T18:04:59+00:00

I would like to program productive and keep my FileSize very small. However I

  • 0

I would like to program productive and keep my FileSize very small.
However I would like to know a few tips how do accomplish that.

For example what is better for a small FileSize:

Either:

if .... = '1' then begin
 ...
end;

or:

if ..... = inttostr(1) then begin
...
end;

or:

if .... = inttostr($0001) then begin
...
end;

or:

case of intvar
  1: ...
  2: ...
end;

Then there is something that I tried and I was surprised.
I made another Unit in my project that stores Strings as constants and then I use the constant vars to replace the strings in my project. For some reason this raises my FileSize although I replace double used Strings as a var now.

Also is it better to store stuff in vars than put them directly into the code?!
For example:

Function1(param1, param2, param3); // this code is used about 20 times in my project

or is it better if I:

Avar = Function1 (param1,param2,param3); // Store this once in a var and then replace it

And what about:

if ... = TRUE 

or:

if ....

Same as:

if .... = FALSE

or:

if not(...)...

Any other tips to program productive for a smaller FileSize?

Thanks in advance.

I use Delphi7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:05:02+00:00Added an answer on June 3, 2026 at 6:05 pm

    I’m sorry to be blunt, but you are putting the cart before the horse.

    If you really want to know how to make your executable smaller without already knowing what differences will result from your code variations in your given examples, you should just stop right now and read/learn/practice until you know more about the language and the compiler.

    Then you’ll understand that your question makes little sense per se, as you can already see by all the pertinent comments you got.

    • the exact same source code can result in vastly different executables and different source code can result in the same executable, depending on the compiler options/optimizations
    • if your main goal is to micro-manage/control the generated exe, program directly in assembler.
    • if you want to know what is generated by the compiler, learn how to use the CPU View.
    • program for correctness first, then readability/maintainability
    • only then, if needed (implies using correct metrics/tools), you can optimize for speed, memory usage or file size (probably the least useful/needed)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a program that will run in background as a
I would like to create a program in a linux/unix environment that runs from
I would like to create a console program in VB.net that would allow parameters.
I would like to know if there is a way to let the program
i would like to program a little app that will change the colors of
I would like my program to be able to access a website that processes
What I want to do: I would like to program a very simple music
I would like to create integration tests for a program that will be connected
I would like to program a computer game which should be played by several
I would like to change a program to automatically detect whether a terminal is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.