• Login
Community
  • Login

CASE statement help lines

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 2 Posters 990 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    rvw80
    last edited by Oct 14, 2022, 1:12 PM

    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?

    f467c164-9793-4b15-9aba-04837102057d-image.png

    thanks in advance for any word!
    Kr
    Ron

    P 1 Reply Last reply Oct 14, 2022, 1:46 PM Reply Quote 0
    • P
      PeterJones @rvw80
      last edited by Oct 14, 2022, 1:46 PM

      @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.

      R 1 Reply Last reply Oct 14, 2022, 1:50 PM Reply Quote 1
      • R
        rvw80 @PeterJones
        last edited by Oct 14, 2022, 1:50 PM

        @PeterJones hi Peter this is SQL

        R 1 Reply Last reply Oct 14, 2022, 1:57 PM Reply Quote 0
        • R
          rvw80 @rvw80
          last edited by Oct 14, 2022, 1:57 PM

          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
          
          R 1 Reply Last reply Oct 14, 2022, 2:03 PM Reply Quote 0
          • R
            rvw80 @rvw80
            last edited by Oct 14, 2022, 2:03 PM

            @PeterJones
            i saw putting CASE between brackets gives this
            90bf7d16-e1f3-4be2-a77d-02c6e909103d-image.png

            would be nice it could give the bracket vertical lining on the CASE itself allready

            P 1 Reply Last reply Oct 14, 2022, 2:38 PM Reply Quote 0
            • P
              PeterJones @rvw80
              last edited by PeterJones Oct 14, 2022, 2:39 PM Oct 14, 2022, 2:38 PM

              @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.

              R 1 Reply Last reply Oct 14, 2022, 2:44 PM Reply Quote 0
              • R
                rvw80 @PeterJones
                last edited by Oct 14, 2022, 2:44 PM

                @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!

                1 Reply Last reply Reply Quote 0
                6 out of 7
                • First post
                  6/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors