Red Gate forums :: View topic - snippet substitution
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5
SQL Prompt 5 forum

snippet substitution

Search in SQL Prompt 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
hamishinglis



Joined: 04 Jul 2012
Posts: 1
Location: United Kingdom

PostPosted: Wed Jul 04, 2012 3:12 pm    Post subject: snippet substitution Reply with quote

I was setting up some snippets and after clicking around on the site saw that if you enter $cursor$ that is where the cursor is left after the snippet is activated. But what i really wanted was the Date!... so i took a guess and put in $DATE$ and it worked... Is there a complete list of substitutions for snippets anywhere? why isn't this stuff with the edit snippet help page?

Also i noticed that snippets do not work if you are inside a /* */ block ? which is sad since in means you can't have a snippet for update comments like your name, the date etc.. so it always makes a consistent comment block. Is there a reason for this?
Back to top
View user's profile Send private message
stanori



Joined: 23 Apr 2012
Posts: 84

PostPosted: Thu Jul 05, 2012 10:50 pm    Post subject: Reply with quote

Hello hamishinglis,

I believe the reasoning for the snippets not working in the comment block is that the parser ignores everything between the comments.

In regards to the list of additional snippets, here are some more:

code = code.Replace("$DATE$", DateTime.Now.ToShortDateString());
code = code.Replace("$TIME$", DateTime.Now.ToShortTimeString());
code = code.Replace("$USER$", Environment.UserName);
code = code.Replace("$MACHINE$", Environment.MachineName);

Best Regards,
Steve
_________________
_________________
Steve Tanori
Product Support
Red Gate Software Ltd.
866-997-0378
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group