Hi all!

Need a little help here: I need to use a .json file instead of a SQL Database (for framework reasons). Itīs gonna be a highscore database for a mobile game and looks like so (example data):

Now I need to READ and WRITE into that "database" but have no clue how to do this. I managed to insert a row like this:

function setHighscore(newtime, newhighscore, newname) {

        //open highscore.json
        var dh = Stream.openFile(this._datei,"r");

        var jsonobject=parseData(dh);//h.toString();

       //set new values

        var dh2 = Stream.openFile(this._datei,"w+");
however this only works if I have an empty data-record on position "5" which will then be filled. But I want it to append whatever new values to the END of the array. since the highscore database will be growing it should determine the last position and insert the new values accordingly.

Next thing, I also need to display the "Top Ten" of this database on a seperate screen. Iīm a noob so please bear with me. This is what I tried to retrieve data:

function getHighscore(nr) {
        //TODO: Exceptions
        var dh = Stream.openFile(this._datei,"r");
        //Parse JSON File

        var data = parseData(dh);
        //return data
        console << data["Highscores"][nr-1]["Time"];
this works fine for just one parameter (in this case Time) but as soon as I add the other ones (name, points) it returns "undefined". What am I doing wrong here?

btw Iīm using Moscrif framework which is a JavaScript derivate...but very similar to it.

many thanks in advance