Re: Bringing it all together.

From: Rob Kennedy (me3_at_privacy.net)
Date: 03/26/04


Date: Fri, 26 Mar 2004 11:09:55 -0600

Richard S Beckett wrote:
> In the ...\Projects\Tool-name Folder, I have a file called
> Tool-name.dpr. This is what I open, and save when making changes to
> the tool.
>
> However, there is nothing in this code area that mentions the version
> number dispplayed in the Help -> About window.

There rarely is. In my experience, a version number is usually either
hard-coded into the form-definition file (DFM), or it's retreived at run
time from the EXE's version-information resource (controlled by the
Version tab on the Project Options dialog box).

> When I then ran Tool-name.exe, the version number had not been
> updated. So, I re-loaded Tool-name.dpr, and ran it using the 'play'
> button, and this time the version number was correct. On exiting I
> was asked if I wanted to save, which I did, and now all seems
> corrcet.
>
> What I would like to know, is how do I ensure that the Tool-name.exe
> file is totally up to date, and what files from the
> ...\Projects\Tool-name Folder do I need to ship to ensure full
> functionality?

It sounds to me like you edited a handful of text files and expected the
EXE file to be updated automatically. Delphi doesn't work that way (and
neither do any other compiled languages I'm aware of -- Delphi ain't
Perl). The EXE file is only updated when you tell the compiler to
compile your code. Pressing the Run button (F9, "play") is one way of
doing that.

Before the Run command executes the program, it compiles it. You can
compile a program without having to also run it by using the Compile
command from the Project menu (Ctrl+F9). That will compile any modified
source files into updated DCU files, and then it will link all the DCU
files (both the updated ones and the ones that didn't need any updating)
into a new EXE file, overwriting the existing program.

A third option is the Build command, also on the Project menu. It's the
same as Compile, except that it always recompiles everything, even the
PAS files that haven't been modified in the meantime. Doing a build is
often necessary when you change compiler options, such as optimization
or range checking. Those changes don't actually modify any files, so
merely doing a compile won't propagate the compiler settings into the
already-compiled units. A build fixes that.

-- 
Rob