HISE Logo Forum
    • Categories
    • Register
    • Login

    Getting an element from an array stored in an external js file

    Scheduled Pinned Locked Moved General Questions
    4 Posts 2 Posters 333 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.
    • L
      LeeC
      last edited by LeeC

      Does anybody know how to print an element stored in an external js file?

      Obviously we need to pull the file into our HISE session using include("Arrayfile.js");
      but how would we then access elements from the file?

      Ultimately, I'm trying to print a random string element from an array stored in a js file to a text label in HISE.

      Cheers

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

        Show me the contents of the file.

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

        1 Reply Last reply Reply Quote 0
        • L
          LeeC
          last edited by LeeC

          Something like this @d-healey
          arrayfile.js

          Hoping to print a element at random to a label

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

            include("arrayfile.js");
            Console.print(fruit.Data[Math.randInt(0, 3)]);
            

            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

            51

            Online

            1.7k

            Users

            11.7k

            Topics

            101.8k

            Posts