HippoEDIT homepage Welcome, Guest. Please login or register.
September 07, 2010, 07:38:43 am
Home Help Search Login Register

+  HippoEDIT - Programmers text editor
|-+  General Category
| |-+  FAQ (Moderators: alex, Stefan)
| | |-+  How to create a command to insert Date, current File Name or Registry key?
« previous next »
Pages: [1] Print
Author Topic: How to create a command to insert Date, current File Name or Registry key?  (Read 834 times)
alex
Developer
Global Moderator
Hero Member
*****

Karma: +19/-2
Offline Offline

Gender: Male
Posts: 1334



View Profile WWW
« on: April 17, 2009, 03:29:05 pm »

Till now there is no macro support in HippoEDIT but there are Code templates Wink

If you need to insert current date in the document or current file name or Registry value you can use Code Templates.

Create and Code Template or for some specific syntax or for Default syntax (to have template available every where), assign to it name and Shorcut, enter text you want with any built-in tag and ... it works.

For example, you would like to insert current date when you edit text document:
  • Open Code Templates setting for Plain Text
  • Add...
  • Key = date, Description = Current Date, Shortcut = Ctrl + Shift + D
  • Ok
  • Enter such code for new template: Today %Date%
  • Ok
  • Now try to press Ctrl+Shift+D somewhere inside of text documen
  • Result: Today 04/17/09
Logged

Arthur
Hero Member
*****

Karma: +1/-0
Offline Offline

Gender: Male
Posts: 597


He who is ashamed of asking is afraid of learning.


View Profile WWW
« Reply #1 on: April 17, 2009, 04:56:23 pm »

Neat! Thank you.
« Last Edit: April 17, 2009, 09:46:41 pm by Arthur » Logged
Arthur
Hero Member
*****

Karma: +1/-0
Offline Offline

Gender: Male
Posts: 597


He who is ashamed of asking is afraid of learning.


View Profile WWW
« Reply #2 on: April 17, 2009, 09:47:15 pm »

Besides, there is no way of extracting code templates for text documents, thus the above is not possible for text files, but why not?
Logged
alex
Developer
Global Moderator
Hero Member
*****

Karma: +19/-2
Offline Offline

Gender: Male
Posts: 1334



View Profile WWW
« Reply #3 on: April 18, 2009, 02:59:11 am »

Could not get you Arthur...

Why you can as extract as use templates in text files.
To extract use menu Format -> Extract Template...
Logged

Arthur
Hero Member
*****

Karma: +1/-0
Offline Offline

Gender: Male
Posts: 597


He who is ashamed of asking is afraid of learning.


View Profile WWW
« Reply #4 on: April 18, 2009, 04:19:02 am »

I have Extract Template disabled in text files, is that not normal?
Logged
alex
Developer
Global Moderator
Hero Member
*****

Karma: +19/-2
Offline Offline

Gender: Male
Posts: 1334



View Profile WWW
« Reply #5 on: April 18, 2009, 04:55:52 pm »

You have to select some text first Wink
Logged

rickprez
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 3


View Profile
« Reply #6 on: April 20, 2009, 02:26:49 pm »

Looks like we are limited to the old "DOS" formats for %DATE% and %DateTime% from our user environment [correct or direct me if I am wrong, please]. Not as flexible in formatting your "Insert Date/Time" menu option, but this works for now.

Thanks for figuring it out Alex.

Rick
Logged
alex
Developer
Global Moderator
Hero Member
*****

Karma: +19/-2
Offline Offline

Gender: Male
Posts: 1334



View Profile WWW
« Reply #7 on: April 20, 2009, 02:43:50 pm »

Yes. There are not so much settings as in Insert Date/Time.
But you can use also %Day%, %Month% and %Year% to form presentation you like. Yes this is still limited, and you could not use verbal representation, but a little bit more freedom.

And I would think about adding commands for inserting date time. The problem there, that number of formats (and so items) are not limited (it can be changed in xml file). So I could not predict how many commands I need for this...
Logged

Pages: [1] Print 
« previous next »
Jump to:  


Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC