Hello i need that my game save in a offline db the scores and show only the first(the highest).
I write this js function:
Then the qml code:Code:function saveHighScore(punti) { var db = openDatabaseSync("VSpeedScore", "1.0", "Local VSpeed Score", 1000); var dataStr = "INSERT INTO Scores VALUES(?)"; var data = punti; db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(score NUMBER)'); tx.executeSql(dataStr, data); var rs = tx.executeSql('SELECT * FROM Scores ORDER BY score desc LIMIT 1'); var r = rs.rows.item(0).score return r }); }
I need an int.Code:Pulsante{ id: bt1 property int multi: 1 property int highscore: 0 punti: 0 [...] bt1.highscore = saveHighScore(bt1.punti)
The error is:
Cannot assign [undefined] to int



