SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Code snippet comments

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Code snippet comments
Author Message
pvdm



Joined: 11 Mar 2008
Posts: 22
Country: New Zealand

Post Code snippet comments Reply with quote
We would like to create Visual Studio style comments on all of our stored procedures and I thought that it would be a good idea to use the code snippets to generate the comment structure, but I have 2 problems.
1. I need a line like this for each parameter
<param name="@param1"></param> but I can not get the "(double quote) to work properly so I am now using the single quote
2. After each line the macro inserts a comma.
My code snippet looks like this:
/*
<summary>
</summary>
"<param name='"$ARGS_V$'></param>
<remarks></remarks>
<returns></returns>
*/

But my output looks like this:

/*
<summary>
</summary>

<param name='@param1'></param>, <-- Notice the "," and single quotes around @param1
<param name='@param2'></param>,
<param name='@param3'></param>,
<param name='@param4'></param>
<remarks></remarks>
<returns></returns>
*/

Is there any way to get it to work properly?
Mon Mar 16, 2009 8:45 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Well, it is indeed working properly and generating technically correct results. It is not generating what you want because you are likely unaware of the special use of macro-variables suffixes and prefixes and especially the use of double quotes for enclosing suffixes and prefixes containing spaces.

$ARGS_V$ - by definition generates vertical list of COMMA-SEPARATED arguments. By vertical, I mean end-of-line symbol added after each comma.

Anything specified immediately before a macro-variable name is a prefix that is repeated for every value and output before each element. In your case it is ""<param name='"" note that I'm enclosing the entire prefix in double quotes so you can see the effective value.

Anything specified immediately after a macro-variable name is a suffix that is repeated for every value and output after each element. In your case it is "'></param>"

The result of your snippet is correct, even though it is not exactly what you want.

Please note that there are currently no macro-variables available for procedure arguments which will not output them as a comma-separated list so that there is no way to get around that. On the other hand, you already got as close as possible to what you wanted. I don't think you can make it any better.
Mon Mar 16, 2009 10:22 pm View user's profile Send private message
pvdm



Joined: 11 Mar 2008
Posts: 22
Country: New Zealand

Post Reply with quote
Thanks.
I was not implying that the code snippets wasn't working properly, just thought there might be another way maybe some secret undocumented macros to get it to do what I wanted ;)
Mon Mar 16, 2009 10:35 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Sorry, all currently available macros are in the list already. We are planning on developing more macros and making them available in v5.x
Mon Mar 16, 2009 10:46 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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
Design by Freestyle XL / Flowers Online.