HISE Logo Forum
    • Categories
    • Register
    • Login

    Globals, arrays and objects....

    Scheduled Pinned Locked Moved General Questions
    6 Posts 2 Posters 36 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

      Er what am I doing wrong here?

      
      
      Globals.padProfiles = [{
      "PadNumber": i+1,
      "TriggerNote": 36,
      "ChokeGroup": 0,
      "ChokeCC": 0,
      "ChokeTime":1200,
      "MIDIPlayerTrigger": -1,
      "PadNoteOffChokes" : true	
      }]; 
      padProfiles[0].TriggerNote = 60;
      

      On start up this tells me..

      Interface:! Line 14, column 28: Cannot assign to this expression!
      Master Chain:! Line 14, column 28: Cannot assign to this expression!

      Have I never understood the limitation of the Globals namespace? (possible as I hardly ever use it..)

      HISE Development for hire.
      www.channelrobot.com

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

        @Lindon and this:

        
        Globals.padProfiles = [{"Note" :36}]; 
        Console.print(padProfiles[0].Note);
        

        tells me:

        Interface:! Line 6, column 34: API call with undefined parameter 0
        Interface:! Line 6, column 34: API call with undefined parameter 0

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon said in Globals, arrays and objects....:

          possible as I hardly ever use it

          Good 😸

          Which lines are those errors referring to?

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @d.healey
            last edited by

            @d-healey in the first example line 14 is:

            padProfiles[0].TriggerNote = 60;
            

            in the second example line 6 is:

            Console.print(padProfiles[0].Note);
            

            HISE Development for hire.
            www.channelrobot.com

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

              @Lindon well............

              I was sure I didn't need to refer to a Global variable in this way but apparently you do:

              Globals.padProfiles = [{
              "PadNumber": i+1,
              "TriggerNote": 36,
              "ChokeGroup": 0,
              "ChokeCC": 0,
              "ChokeTime":1200,
              "MIDIPlayerTrigger": -1,
              "PadNoteOffChokes" : true	
              }]; 
              Globals.padProfiles[0].TriggerNote = 60;
              

              HISE Development for hire.
              www.channelrobot.com

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

                @Lindon nope that aint it...something else is broken...

                and its a line in my code..so that is the solution... just need to refer to Globals explicitly

                HISE Development for hire.
                www.channelrobot.com

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

                40

                Online

                2.1k

                Users

                12.9k

                Topics

                112.2k

                Posts