Forum

    • Register
    • Login
    • Search
    • Categories

    Variable types and scope....question

    General Questions
    2
    3
    61
    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.
    • Lindon
      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 Hart
        Christoph Hart last edited by

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

        Lindon 1 Reply Last reply Reply Quote 0
        • Lindon
          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

          5
          Online

          1.1k
          Users

          6.8k
          Topics

          62.7k
          Posts