I try to use the onlineBackupAPI to load and save my database.
But I fail with these functions:
Code: Select all
Function p_LoadGame()
DebugPrint("p_LoadGame()")
Local Dataset$ = FileRequest(c$[4],"hsgdb")
If Dataset$ <> ""
db:close_vm(false)
db:close()
db = sqlite3.open(Dataset$)
EndIf()
EndFunction
Function p_SaveGame()
DebugPrint("p_SaveGame()")
Local Dataset$ = FileRequest(c$[10],"hsgdb")
If Dataset$ <> ""
Local backup = sqlite3.open(Dataset$)
Local pBackup = sqlite3.sqlite3_backup_init(backup, "main", db, "main");
sqlite3:sqlite3_backup_step(pBackup, -1);
sqlite3:sqlite3_backup_finish(pBackup);
EndIf()
EndFunction
any idea how to use the feature correctly?