HISE Logo Forum
    • Categories
    • Register
    • Login

    Check if component exist

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 152 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.
    • ulrikU
      ulrik
      last edited by

      I'm building a RangeKnob factory and I want to check if a component already exists or not, so I tried this:

      if (!isDefined(Content.getComponent(name)))
      	{
                       Content.addPanel(name, ......);
              }
      

      and yes it works however I get a console message saying:
      Skärmavbild 2022-12-27 kl. 12.35.15.png

      Is it possible to check if a component already exists without getting this console message?

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

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

        What about Console.print(Content.getAllComponents("name").length); ?

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

        ulrikU 1 Reply Last reply Reply Quote 2
        • ulrikU
          ulrik @d.healey
          last edited by

          @d-healey yes, that's it, thank you David!

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

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

          14

          Online

          1.7k

          Users

          11.8k

          Topics

          102.4k

          Posts