HISE Logo Forum
    • Categories
    • Register
    • Login

    Variable types and scope....question

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 129 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.
    • LindonL
      Lindon
      last edited by

      So here's todays question:

      If I have a panel with a mouse callback function declared, I cant use local declarations in those call backs right?

      so what if I call an inline function from within my mouse call back - can I use local variables there ?

      e.g.

      inline function myFunction()
      {
           local myLocal = "Hello";
           Console.print(myLocal);
      
      };
      
      
      
      const var myPanel = Content.getComponent("myPanel");
      myPanel.setMouseCallback(function(event)
      {
          if (!event.mouseUp)
          {
              if (event.clicked)
              {
                 myFunction();
              }
          }
      });
      

      HISE Development for hire.
      www.channelrobot.com

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Yes this should be possible - what happens when you run that script?

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

          @Christoph-Hart - it seems to work....I'm just a bit warey...it practical; terms its a fair few functions being called...in a fair few places...

          HISE Development for hire.
          www.channelrobot.com

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

          38

          Online

          1.8k

          Users

          12.0k

          Topics

          104.4k

          Posts