Inserting datetime via snippet for custom comment block
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Inserting datetime via snippet for custom...Expand / Collapse
Author
Message
Posted 04/16/2008 12:09:05 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 7:29:50 PM
Posts: 119, Visits: 636
I would like to create a snippet to insert a custom comment block with my initials (which I want to make a task list token) and the datetime when i call the snippet

'CRH: <datetime>

' -- < my comments will go here >

I thought I was getting the hang of the snippet editor but can't seem to find the magic words to get it to insert the current date and time when it intellisenses the snippet. 

I have a macro that does it, which I dragged onto the tools menu and as a 'button' on the standard toolbar (that was an accident) and that works but I'd like to know how to have a snippet insert datetime.now or datetimenow.tolongstring() or whatever

Second part of question : for some reason today I can't create a new Task List Token.  The ADD choice is greyed out.  Thought it was working before.  Any idea what I could have done to break it?

TIA

Charles 

Post #15691
Posted 04/16/2008 12:21:15 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 7:29:50 PM
Posts: 119, Visits: 636
Okay, figured out the add a token part.  You have to type in the name of the token first, then the ADD button activates. 

For lurkers not familiar with this cool tip: 

If you create a token for the task list

you can then put (your own initials )

'CRH:

in a comment and all such references will be listed with jump to links in the task list

( now if I could just figure out how to get the snippet that inserts it when I type crh TAB to put in the current date time as well ... )

Post #15692
Posted 04/16/2008 12:34:32 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
I think the Function element is what you want.

http://msdn2.microsoft.com/en-us/library/ms171427.aspx

You'd define an object or literal, then add the function tag, with the function you'd like to run...I think.
Post #15694
Posted 04/16/2008 12:53:36 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 7:29:50 PM
Posts: 119, Visits: 636
Thanks Greg - I looked at that but it seems to only be for C# and also there are only three functions.

I guess the literals just don't resolve when you intellisense them in.  I have worked around it using macros which are also kind of fun

I'll post back here if I ever figure out an intellisense version ...

Post #15696
Posted 04/16/2008 2:01:27 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
Ah, so it seems. I don't see any way to do this either.

You could use CodeSmith ($). They have a VS snippet like feature, only you can program what the snippet does.
Post #15703
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 11:44pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.