HISE Logo Forum
    • Categories
    • Register
    • Login

    Combining string and server response object data

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 313 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 Former User
      last edited by

      I have a text which is a combination of string and server response object data like this:

      "New Version (v" + response.CurrentVersion") is available. Click to Download"
      

      How can I print this text inside a Panel with Paint Routine? Below one doesn't work.

      const var PrintedText = "New Version (v" + response.CurrentVersion") is available. Click to Download";
      
      
      Panel1.setPaintRoutine(function(g, h)
      	      { 
      	      	g.setColour(0xFFFFFFFF); 	
      	      	g.setFont("Arial", 13);	   
      	      	g.drawAlignedText(PrintedText, [0, 10, 207, 20], "centred");   
      	      });
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @A Former User
        last edited by

        @Steve-Mohican

        Your paint routine is fine. Your text string is not valid (try using Console.print() to test it)

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

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @d.healey
          last edited by A Former User

          @d-healey it says undefined. How can I convert this object data to a string?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @A Former User
            last edited by

            @Steve-Mohican

            Your string is not formed correctly, you are missing a +

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

            ? 1 Reply Last reply Reply Quote 0
            • ?
              A Former User @d.healey
              last edited by A Former User

              @d-healey When I remove the +, it still doesn't work.

              If you want to teach me, you just can do it with writing the solution, no need to make me struggle man :)

              Besides if I would know how to combine with these different data types, I wouldn't ask ;)

              LindonL d.healeyD 2 Replies Last reply Reply Quote 0
              • LindonL
                Lindon @A Former User
                last edited by

                @Steve-Mohican said in Combining string and server response object data:

                @d-healey When I remove the +, it still doesn't work.

                If you want to teach me, you just can do it with writing the solution, no need to make me struggle man :)

                Besides if I would know how to combine with these different data types, I wouldn't ask ;)

                I dont think you read what Dave said -- he didnt say remove a +, he said you were missing one.

                As he said - use Console.print to debug your code... then you wouldnt need to ask at all...

                HISE Development for hire.
                www.channelrobot.com

                1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @A Former User
                  last edited by d.healey

                  @Steve-Mohican said in Combining string and server response object data:

                  no need to make me struggle

                  Best way to learn ;)

                  const var PrintedText = "New Version (v" + response.CurrentVersion + ") is available. Click to Download";
                  

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

                  ? 1 Reply Last reply Reply Quote 1
                  • ?
                    A Former User @d.healey
                    last edited by

                    @d-healey said in Combining string and server response object data:

                    @Steve-Mohican said in Combining string and server response object data:

                    no need to make me struggle

                    Best way to learn ;)

                    You're right, that's something that I'll never forget. Thank you so much mate, you are the Best! :love-you_gesture_dark_skin_tone:

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

                    31

                    Online

                    1.8k

                    Users

                    12.0k

                    Topics

                    104.1k

                    Posts