Forum > IDE/CodeTools

Code Templates and Today's Date

(1/2) > >>

Is it possible to build a code template which includes today's date? A macro something like $Date()? I couldn't see any macros available to do that.

Look at the FPC documentation.
You can use :

--- Code: ---
{$I %DATE%}
{$I %TIME%}

--- End code ---

That doesn't do what I want. What I want to do is define a code template called, say, com. The template for com will look like:

// Changed: %DATE% Comment

I want %DATE% to be automatically substituted with today's date when I insert this comment line in code with "com" then CTRL+J so the text will be inserted as:

// Changed: 27/03/2006 Comment

I added the code macros $date, $time and $datetime.
Create a new template and add whatever you need.


--- Quote from: "mattias" ---I added the code macros $date, $time and $datetime.

--- End quote ---

Thanks. I just tried them in Lazarus 0.9.14 and they work great!


[0] Message Index

[#] Next page

Go to full version