Forum
    • Categories
    • Register
    • Login

    Hoping this is an easy one! Version number with 2 decimal places

    Scheduled Pinned Locked Moved Scripting
    19 Posts 2 Posters 499 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.
    • David HealeyD
      David Healey @DanH
      last edited by

      @DanH What do you see with

      Console.print(data.version < "2.0.1");

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

      DanHD 2 Replies Last reply Reply Quote 0
      • DanHD
        DanH @David Healey
        last edited by

        @d-healey said in Hoping this is an easy one!:

        Console.print(data.version < "2.0.1");

        I get "0"...

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

        1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @David Healey
          last edited by

          @d-healey the below gives me an error though

          Console.print(data.version);
          

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @DanH
            last edited by

            @DanH said in Hoping this is an easy one! Version number with 2 decimal places:

            the below gives me an error though

            You need to tell me what the error is.

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

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @David Healey
              last edited by

              @d-healey

              API call with undefined parameter 0
              

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @DanH
                last edited by

                @DanH So data.version is undefined.

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

                DanHD 1 Reply Last reply Reply Quote 0
                • DanHD
                  DanH @David Healey
                  last edited by

                  @d-healey yup struggling to figure out why though.... Here's a longer version of the script

                  inline function loadVersionFile() {
                  	local appDataDir = FileSystem.getFolder(FileSystem.AppData);
                  	return appDataDir.getChildFile("Version.js");
                  }
                  
                  inline function checkOnLoadSettings()
                      {
                  		local HVersion = loadVersionFile();
                  		
                      		if (HVersion.isFile())
                      			{
                  					local data = Engine.loadFromJSON("..//Version.js");
                  					
                  					if (data.version <"2.0.4")
                  		   				 {
                  								HUpdate_Panel.showControl(1);
                  						 }
                  			
                  						else 
                  							{
                  								HUpdate_Panel.showControl(0);
                  							}
                  				 }
                  		
                  		else
                  		{
                  			HUpdate_Panel.showControl(1);
                  		}
                  		
                  	}
                  	
                  checkOnLoadSettings();
                  

                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                  https://dhplugins.com/ | https://dcbreaks.com/
                  London, UK

                  David HealeyD 1 Reply Last reply Reply Quote 0
                  • David HealeyD
                    David Healey @DanH
                    last edited by

                    @DanH Use File.loadAsObject()

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

                    DanHD 1 Reply Last reply Reply Quote 0
                    • DanHD
                      DanH @David Healey
                      last edited by

                      @d-healey instead of ...?

                      Also how do you get the red text in here? 😆

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

                      David HealeyD 1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @DanH
                        last edited by

                        @DanH Code tags for red text (a single backtick at the start and end. `

                        Instead of Engine.loadFromJSON() - You already went to the trouble to get the file object so you might as well use it.

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

                        DanHD 1 Reply Last reply Reply Quote 0
                        • DanHD
                          DanH @David Healey
                          last edited by

                          @d-healey Righto, thanks!

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

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

                          31

                          Online

                          2.1k

                          Users

                          13.0k

                          Topics

                          113.0k

                          Posts