Code:

// Usage: // // Load the config file: // Get LoadConfig of ghoJsonConfig {optional-filename} {optional-path} to bOK // // If not supplied the default filename is "config.json" and the path is the // programs directory of your current workspace. If you pass an empty // filename then "config.json:" will be used. There is no requirement for // filename extension to be ".json" (although that _would_ seem sensible). // // Reading a setting: // Move (Config("foo.bar.baz[3].bob")) to nVar // nVar is now 42 // Or: // Get Config "foo.bar.baz[3].bob" to sVar // sVar is now "42" // // Which would return the setting in the file from: // { // "foo" : { // "bar" : { // "baz" : [ // 66, // { // "jim" : "jack" // }, // false, // { // "bob" : 42 <--- This one! // }, // { // "kim" : "possible" // } // ] // } // } // } // // (If "Config" conflicts with anything in your environment you can simply // change the name of the global function at the bottom of the package.) // // It should handle multi-dimentional arrays (i.e. foo[3][22][6]) and JSON of // arbitrary depth and length. // // Attempts to get settings which are not in the JSON will return empty strings. // // NOTE: JSON is case-sensitive, so your search-strings must exactly match the // object names ("foo" is *not* "Foo") in the JSON file.