HISE Logo Forum
    • Categories
    • Register
    • Login

    "Unexpected character" bug?

    Scheduled Pinned Locked Moved Scripting
    5 Posts 2 Posters 105 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      The code in red here is triggering an error,
      "Unexpected character ' ' in source":

      Screenshot 2025-05-02 at 2.22.20 PM.png

      The variable on which the error is occurring is declared on line 485,
      then used on line 502, both without problem.

      The error itself does not relay what character is unexpected, as that field is blank (' ').

      Ideas?
      A bug?

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

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

        @VirtualVirgin What is String() on the line above?

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

        1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin
          last edited by

          I tried retyping the lines and it came up red again.
          Then I copy and pasted the same lines from the one just above, and now the error is gone:

          Screenshot 2025-05-02 at 2.26.00 PM.png

          Perplexed!

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

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

            @VirtualVirgin If you copied and pasted originally from somewhere outside of HISE then hidden characters may have been added - ChatGPT does this.

            Still, what is String()? Is that a function you wrote?

            You can use myString.contains() instead of indexOf - It does the same thing in this case but more clearly shows the intention of the code.

            Another tip, use isDefined() instead of != undefined

            const test = 0;
            
            Console.print(test != undefined); // 0
            
            const test = 0;
            
            Console.print(isDefined(test)); // 1
            

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

            VirtualVirginV 1 Reply Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @d.healey
              last edited by

              @d-healey I asked Gemini to edit a block I was working on but now I have rewritten that entire section so the String() is not being used at all. It was trying to convert the cellValue to a string, which was not necessary anyway.

              You can listen to my orchestral mockups here:
              https://www.virtualvirgin.net/

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

              39

              Online

              1.7k

              Users

              11.8k

              Topics

              103.0k

              Posts