Per my previous message, I did learn how to embed the compile date into a form.
Add a blank form to your project. I called it 'Compile_Date'. After the first compile you'll also have a Compile_Date.DFM which is something you can modify *BEFORE* you do...
Application.CreateForm(TCompile_date, Compile_date); {in your main.DFM}
So, in the CreateForm event for the MAIN form, you can include the following, which will automatically update the 'Compile_date.DFM' only while you are running it in your development environment. (FileExists)
procedure TmainForm.formcreate(Sender: TObject);
var
slVersion : tstringlist;
i : integer;
const
Version : string = 'Compile_Date.DFM';
begin
slVersion := tstringlist.create;
if FileExists(Version) = true then
begin
slVersion.LoadFromFile(Version);
for i := 0 to slVersion.Count - 1 do
if pos('Caption',slVersion[i]) > 0 then
SLVersion[i] := 'Caption = ''' + DateTimeToStr(now) + '' ;
slVersion.SaveToFile(Version);
end;
end;
Bottom line: its an easy solution, but I'll go one better. The folks at Embarcadero (Delphi) now have a TCompile Unit!!! It has MUCH more than just a compile date. :)
The unit file 'Project.pas' contains the following constants:
PROJECT_NAME: The name of the project.
EXE_FILENAME: The file name of the project.
DATE_CREATED: The date that the project was originally created.
AUTHORS_NAME: The name of the people who wrote the code for the project.
CONTACT_INFO: Contact information: eMail, phone number, address, etc.
COMPILE_DATE: Date project last ran inside Delphi.
COMPILE_TIME: Time project last ran inside Delphi.
BUILD_NUMBER: Number of times the project has been ran from inside Delphi.
UNIQUE_IDKEY: Unique identifier for the project. It has the ProjectName, CompileDate and CompileTime. NOTE: This constant is updated every compile to reflect the current compile date and time.
http://cc.embarcade..tem/25359
The only negative I can see is that you need to also embed your project path. So, don't move the puppy!
Regards,
Jim8's