Code Templates and Today's Date lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- Anonymous · 2006-03-27 01:23 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. ---------------------------------------------------------------------- pch · 2006-03-27 07:30 Look at the FPC documentation. You can use : Code: [Select] {$I %DATE%} {$I %TIME%} ---------------------------------------------------------------------- Anonymous · 2006-03-27 22:32 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 ---------------------------------------------------------------------- mattias · 2006-03-29 09:37 I added the code macros $date, $time and $datetime. Create a new template and add whatever you need. ---------------------------------------------------------------------- Anonymous · 2006-04-07 01:37 Quote from: "mattias"I added the code macros $date, $time and $datetime. Thanks. I just tried them in Lazarus 0.9.14 and they work great! ---------------------------------------------------------------------- MarkMLl · 2022-06-30 19:58 Quote from: GirlBurl on June 30, 2022, 08:38:52 pmI created a new template and added the code macros $date, $time and $datetime to try them out in Lazarus, it worked for me too. (Clears throat) You're adding a "me too" to a message which is 16 years old. Please don't do that, or people will start suspecting that you're a potentially-malicious AI responding to patterns it recognises. MarkMLl