Delphi Short Cut to add date and name Comment

Does anyone know of a short cut to put my name and date when the cursor is ie

//021208 DarkAxi0m 

therefore, I will not check what date is when I add comments.

Im using Delphi7 with CnPack and GExperts installed. I think this should be done with one of these experts.

+4
source share
6 answers

I use GExperts for this, for example:

in

GExperts \ Configuration

Select the Editor’s Experts tab.

In the list of experts, select

Insert date \ time

Click on the configuration, insert the desired text:

'//' ddmmyy 'DarkAxi0m:' // 021208 DarkAxi0m:

Then, to insert a new comment on the date name, you only need:

Ctrl + Alt + a

I install most programmers on this assignment.

+4
source

This is also easy to do with the Expand Macro template from GExperts (found in the Expert Editor).

I use this extension to enter yyyy-mm-dd at the current position:

% YEAR% -% MONTH% -% DAY% |

+2
source

For a solution that will work in most Windows applications, not just Delphi, you can use Authotkey (free, autohotkey.com). One of its many features is the ability to expand the lines you enter, usually used to automatically correct typos.

I run all my shortcuts with a semicolon, since it almost never leads the lines that I type in real life, so in your example, to insert a sequence of comments-username, I would like to enter a semicolon, slash

 ;// 

An Authotkey script (which you can put in a .ahk text file and add the file to Autostart) will look like this:

 ::;//:: ; this means: when I type ";//", do what follows FormatTime, curDate,, yyyy-MM-dd ; the double comma is intended SendInput // %curDate% %A_UserName% ; variable expansion return 

This leads to the following conclusion:

 // 2008-12-05 moodforaday 

The AHK syntax is a bit tight, but there is an extensive help file.

While editing: this script can be expanded to apply the correct comment syntax depending on the environment in which you are currently working. You must define the title of the active window, find the signature substring ("Delphi"), and select the correct comment character. Thus, you can enter the same hotline to insert a comment regardless of the current environment or language. You can also use SendInput to arrange the caret in the same way that Delphi templates do.

+2
source

Nothing found in CnPack / Soure templates. Added template.

  //%Date% DarkAxi0m 

Note: I have to look carefully at the menu.

+1
source

You can also view the Live Templates feature, which can be scripted to do exactly what you want:

http://cc.codegear.com/Item/24990

Do not delay the name, it includes a script template to include the date, time, including the ability to format as you want.

+1
source

Here's an option with GExperts (www.gexperts.org) that makes it easy to look for changes based on developer or date.

Example output and comment:

  //07.25.2009 (SLB20090725) - Added 3rd optional parameter. 

Besides the easy-to-read date, I can easily find comment programmers by year, year + month, etc.), For example, I can search (SLB200905 for any comments that I registered in May 2009.

To do: In the GExperts menu, open "Configuration ..." (at the bottom of the list), then select the "Editor’s Experts" tab. Find "Insert Date / Time" and double-click on it.

//mm.dd.yyyy '(ABC'yyyymmdd') - '

Where ABC is the programmer’s name, initials, identifier, or something else.

Then use Ctrl-Alt-A when in the Delphi IDE to paste

This should work on any version of Delphi supported by GExperts.

+1
source

All Articles