Community
    • Login

    UDL and hex prefix

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 1.1k Views 2 Watching
    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.
    • Alan BourkeA Offline
      Alan Bourke
      last edited by

      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

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @Alan Bourke
        last edited by

        @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

        Alan BourkeA 1 Reply Last reply Reply Quote 0
        • Alan BourkeA Offline
          Alan Bourke @Ekopalypse
          last edited by

          @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

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP Online
            PeterJones @Alan Bourke
            last edited by

            @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

            Alan BourkeA 1 Reply Last reply Reply Quote 2
            • Alan BourkeA Offline
              Alan Bourke @PeterJones
              last edited by

              @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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors