HISE Logo Forum
    • Categories
    • Register
    • Login

    Shouldn't the existence of data return a "true" in this case?

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 46 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

      My impression is that this should return "true":

      const var Panel1 = Content.addPanel("Panel1",0,0);
      Panel1.data.text = "TEST";
      Console.print(Panel1.data.text ? "true" : "false");
      

      I thought the existence of some data returns a 1 or true.
      Is that not the case?

      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 Looks correct to me, we could reduce it to this

        Console.print("TEST" == 1); //0

        If you want to know if a value exists you could use isDefined() or for text specifically you can use != ""

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

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

        26

        Online

        1.8k

        Users

        12.1k

        Topics

        104.9k

        Posts