SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Customizing code formatting

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Customizing code formatting
Author Message
andrijz



Joined: 13 Jan 2010
Posts: 7
Country: Ukraine

Post Customizing code formatting Reply with quote
Hi!

I see in the documentation and have proved that:
"The keywords which are in the pattern but not in the SQL statement are ignored during the processing and do not affect the results."
So, is there any possibility to add my own keywords and apply formatting rules with these new keywords?

Thanks,
Andriy
Thu Jan 21, 2010 8:19 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Yes, you can add your own keywords and your own formatting patterns. Just for the record, formatting patterns are technically independent from keywords. Keywords listed in the options are evaluated for word case formatting. Formatting patterns are valuated when the text is parsed and affect how the text is formatted if it matches one or more patterns. Please note that pattern names, are just names, most of them have keyword matching names only to describe type of statement or unit of code they could be applied to.

If you want to add new keywords, open SQL Assistant options dialog -> Code formatting tab -> select formatting style in the left top list -> expand Keywords section on the right -> edit keywords list as required. Note about [Preferred keywords] section on that list, this section affects which keywords and SQL structures appear on top in the keywords prompts.

If you want to add new patterns, open SQL Assistant options dialog -> Code formatting tab -> select formatting style in the left top list -> right-click on the formatting rules list on the left -> Choose Add from the context menu -> Enter rule name -> enter formatting pattern on the right.
Thu Jan 21, 2010 7:51 pm View user's profile Send private message
andrijz



Joined: 13 Jan 2010
Posts: 7
Country: Ukraine

Post Reply with quote
Thank you very much for the comment.
But still, something doesn't work :(
1) I've added 3 keywords: data, set, run
2) I've added the pattern:
data ... ;
set ... ;
run;

The result is following
From Input:
DATA d; SET s; RUN;

I had output:
data d ;
set s; run;

I expected to have "run;" starting from a new line.
Could you explain why it is so?

Thanks,
Andriy
Fri Jan 22, 2010 3:29 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I don't think this one will work the way you enter it. Basically, you enter 3 SQL statements in a single formatting pattern. It is not designed for that. Single statement or SQL unit like BEGIN ... END is expected per formatting pattern.

You may need to enter 3 separate patterns – 1 for each statement. In each pattern if required you can add additional line breaks and spaces after and before the statement.
Fri Jan 22, 2010 9:41 am 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.