• Login
Community
  • Login

UDL and hex prefix

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 610 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.
  • A
    Alan Bourke
    last edited by Sep 12, 2022, 9:24 AM

    Notepad++ v8.4.4 x64

    I’m trying to create a UDL for a dialect of BASIC. This dialect uses the dollar sign as a prefix for hex numbers.

    In the Comment & Number section I have:

    Prefix 2: $
    Extras 2: A B C D E F a b c d e f

    However this only works for numbers like:

    $1
    $2
    $123

    These don’t work:
    $a
    $A
    $4b, $48, $46, $43, $40, $3d, $3b

    What am I missing here?

    Thanks

    E 1 Reply Last reply Sep 12, 2022, 9:42 AM Reply Quote 0
    • E
      Ekopalypse @Alan Bourke
      last edited by Sep 12, 2022, 9:42 AM

      @Alan-Bourke said in UDL and hex prefix:

      $a
      $A
      $4b, $48, $46, $43, $40, $3d, $3b

      If I understand your question correctly, add it to Extras 1 like
      described here

      6741417c-9359-4530-a393-8ce94d7db961-image.png

      A 1 Reply Last reply Sep 12, 2022, 10:41 AM Reply Quote 0
      • A
        Alan Bourke @Ekopalypse
        last edited by Sep 12, 2022, 10:41 AM

        @Ekopalypse
        Thanks, I’ve done that and added ‘,’ in Suffix 2 so that lists of numbers work, however it seems to be having an issue with the letter ‘e’ …

        2022-09-12 11_37_53-User Defined Language v.2.1.0.12.png

        P 1 Reply Last reply Sep 12, 2022, 3:01 PM Reply Quote 0
        • P
          PeterJones @Alan Bourke
          last edited by Sep 12, 2022, 3:01 PM

          @Alan-Bourke ,

          Per documentation here :

          • Prefix1 and Suffix2 only work with 0-9
          • Prefix2 only works with 0-9 and Extras1
          • Extras2 only works with 0-9 and Suffix1

          To accomplish what I think you want, I would set

          • Prefix2 = $
          • Extras1 = A B C D E F a b c d e f
          • Operators1 = ,

          This will make the comma an operator which doesn’t require spaces. Since comma is an operator in BASIC, this seems reasonable to me. And it allows the comma to be a list separator inside your list of hex numbers

          DATA AS BYTE $7f, $82, $85
          DATA AS BYTE $bb, $be, $c1
          DATA AS BYTE $fe, $fe, $fe
          

          f7ca80a7-1586-4575-b910-a6d8ae20b3d1-image.png
          baec9f65-23b6-4e57-b7bc-da249cdf064a-image.png

          A 1 Reply Last reply Sep 12, 2022, 4:27 PM Reply Quote 2
          • A
            Alan Bourke @PeterJones
            last edited by Sep 12, 2022, 4:27 PM

            @PeterJones said in UDL and hex prefix:
            That has cracked it thanks. The ‘e’ issue was because I had

            end sub

            in Folding style 1 Close, I should have had

            ‘end sub’

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