 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
andrijz
Joined: 13 Jan 2010 Posts: 7 Country: Ukraine |
|
Customizing code formatting |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
andrijz
Joined: 13 Jan 2010 Posts: 7 Country: Ukraine |
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|