Creating a config file for a panel

Home Forums General Programming Creating a config file for a panel

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #727
    dasfaker
    Keymaster
      • Topics: 80
      • Replies: 793
      • Total: 873
      • ★★★

      Hi Atom

      I’m forced to ask you as I’m unable to understand the file object.

      I want to create a config file to store some variables that will be read when the panel is opened. So I want to access to the panel’s path and create the file there. What I cannot solve is how to create the file with the panel’s path, it must be easy but I don’t get it.

      Thx in advance.

      #4822
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        the best way is to store your config in the OS defined place, don’t be smarter then the OS, to get a MyPanel.ini in a cross platform place do:
        [code:wx624ovv]
        configFile = File("").getSpecialLocation(File.userApplicationDataDirectory):getChildFile(_strj("MyPanel.ini"))
        [/code:wx624ovv]

        #4823
        dasfaker
        Keymaster
          • Topics: 80
          • Replies: 793
          • Total: 873
          • ★★★

          What’s _strj? It gives an error.

          #4824
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            Ah it might not be there yet try: toJuceString()

            #4825
            dasfaker
            Keymaster
              • Topics: 80
              • Replies: 793
              • Total: 873
              • ★★★

              attempt to call global ‘toJuceString’ (a nil value)

              #4826
              atom
              Keymaster
                • Topics: 159
                • Replies: 2945
                • Total: 3104
                • ★★★★★

                Allright then just type String("MyPanel.ini") that will work 100%

                #4827
                dasfaker
                Keymaster
                  • Topics: 80
                  • Replies: 793
                  • Total: 873
                  • ★★★

                  Yeah, its working now.

                  Dzięki.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • The forum ‘Programming’ is closed to new topics and replies.
                There is currently 0 users and 60 guests online
                No users are currently active
                Forum Statistics
                Threads: 2,495, Posts: 17,374, Members: 77,605
                Most users ever online was 12 on January 22, 2019 3:47 pm
                Ctrlr