HISE Logo Forum
    • Categories
    • Register
    • Login

    To string OnlyExtension

    Scheduled Pinned Locked Moved Scripting
    6 Posts 3 Posters 182 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.
    • d.healeyD
      d.healey
      last edited by d.healey

      Something strange here.

      This gives an error (constant not found)

      const f = FileSystem.getFolder(FileSystem.Downloads);
      
      Console.print(f.toString(f.OnlyExtension));
      

      But this doesn't

      const f = FileSystem.getFolder(FileSystem.Downloads);
      
      Console.print(f.toString(f.Extension));
      

      But the docs say to use OnlyExtension. I had a look in the source code and that leads to confusion.

      	addConstant("FullPath", (int)FullPath);
      	addConstant("NoExtension", (int)NoExtension);
      	addConstant("Extension", (int)OnlyExtension);
      	addConstant("Filename", (int)Filename);
      

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      ustkU 1 Reply Last reply Reply Quote 1
      • ustkU
        ustk @d.healey
        last edited by

        @d-healey Yeah I always use 0,1,2,3 instead now I remember them...

        Can't help pressing F5 in the forum...

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @ustk
          last edited by

          @ustk yeah I'm a numbers guy on this one too-it never seems to work for me to use the constants

          HISE Development for hire.
          www.channelrobot.com

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey
            last edited by

            The constants work fine, and make it easier to understand the code. The only issue I've had is this mismatch between the docs and the actual working constant.

            The constants are part of the file object so you have to do something like this.

            Console.print(myFile.toString(myFile.FullPath));

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            LindonL 1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon @d.healey
              last edited by Lindon

              @d-healey yep -well aware of how its supposed to work....I think its just history for me - habit formed when it didnt work,,,

              HISE Development for hire.
              www.channelrobot.com

              1 Reply Last reply Reply Quote 1
              • d.healeyD
                d.healey
                last edited by d.healey

                @Christoph-Hart Can we get a fix for this? I keep falling in this hole.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                45

                Online

                1.7k

                Users

                11.7k

                Topics

                102.1k

                Posts