CASE statement help lines
-
left is np++ right another tool (TOAD)
theres a nice help lines indicating the structure for my case statement;
anyone know of anything in np++ that would get me something similar?thanks in advance for any word!
Kr
Ron -
@rvw80 ,
You don’t tell us what language you are using; since there are more than 80 languages in Notepad++, that makes it hard to replicate your results, since you would be relying on the person who is helping you to just happen to recognize what language it is you are using. You also don’t give us any example text in a text box using the
</>
button in the post-creating window, so instead of being able to copy/paste your example text, we have to read a shrunken image and then type it ourselves. :-(That said, the folding and the indent guides together are supposed to indicate the current level for code blocks.
If you look on the folding column from row 154 to 174 (the entirety of the active CASE region), the folding for that section is marked red, as the active fold. (That color is set by the Settings > Style Configurator > Global Styles > Fold active color setting)
Normally the indent guides (the dotted vertical lines) also help with that, but since yours seem to be every character, rather than every Nth character, they seem less useful to me. Do you have your tab size set to 1 for the active language (Settings > Preferences > Language >
<language name>
> Tab size)? I guess that might make sense if you really don’t want a fixed column width (it looks like some of your columns are 5, some are 6, if I count invisible spacing correctly in your image), but that would annoy me to no end – why not set it to 5 or 6 characters and have consistent column alignment? Oh, well, to each their own. -
@PeterJones hi Peter this is SQL
-
this is a snippet of the SQL:
CASE WHEN -- any trx_class except CM apsa.class <> 'CM' THEN CASE WHEN -- due after as-of-date apsa.due_date > to_date(to_char(aod.asofdate,'YYYY/MM/DD')) THEN CASE WHEN 'Local Currency' = 'Local Currency' AND apsa.exchange_rate_type IS NOT NULL THEN ar_arxagmw_xmlp_pkg.due_amt_as_of_date(aod.asofdate ,apsa.amount_due_remaining ,apsa.payment_schedule_id ,apsa.class) * apsa.exchange_rate ELSE ar_arxagmw_xmlp_pkg.due_amt_as_of_date(aod.asofdate ,apsa.amount_due_remaining ,apsa.payment_schedule_id ,apsa.class) END ELSE -98 END ELSE -- apsa.class = 'CM' CASE WHEN trunc(apsa.gl_date_closed) <= trunc(to_date(to_char(aod.asofdate,'YYYY/MM/DD'))) THEN -99 ELSE CASE WHEN 'Local Currency' = 'Local Currency' AND apsa.exchange_rate_type IS NOT NULL THEN ar_arxagmw_xmlp_pkg.due_amt_as_of_date(aod.asofdate ,apsa.amount_due_remaining ,apsa.payment_schedule_id ,apsa.class) * apsa.exchange_rate ELSE ar_arxagmw_xmlp_pkg.due_amt_as_of_date(aod.asofdate ,apsa.amount_due_remaining ,apsa.payment_schedule_id ,apsa.class) END END END
-
@PeterJones
i saw putting CASE between brackets gives this
would be nice it could give the bracket vertical lining on the CASE itself allready
-
@rvw80 ,
As I said, Notepad++'s solution for showing you what level of code-folding you are at is to color the folding indicators on the left, which all your screenshots have shown is working right.
The red you showed in your most recent screenshot is the parentheses-matching feature of Notepad++, which is independent of language and a completely separate feature from the block/folding indicator already described. (It works even when no language is selected – ie, on plain text, which has no concept of blocks/folding.)
And as this Forum’s various FAQs, including the “Please Read Before Posting”, we fellow users in the Forum cannot make changes to the codebase for you. We can only help you with features that are already there, and sometimes make suggestions for workarounds. Even if you do follow the FAQs to figure out where to make a feature request, it is my guess that the developers would not implement anything new, because Notepad++ already shows you which level of block/folding you are at.
-
@PeterJones
now i see what you mean with that
Settings > Style Configurator > Global Styles > Fold active color setting
hadnt noticed that! that helps
thanks for you replies!