function ConfigSave() File$="config11.txt" f=OpenTowrite(File$,0) if f WriteString ( f, Config.FileVersion$ ) WriteString ( f, Config.PlayerName$ ) WriteString ( f, Config.NetworkName$ ) WriteString ( f, Config.ServerIP$ ) Writeinteger( f, Config.ServerPort ) Writeinteger( f, Config.BackgroundColor) Writeinteger( f, Config.BackgroundMaterial) Writeinteger( f, Config.Board) Writeinteger( f, Config.Notation) Writeinteger( f, Config.GridSnap) closefile(f) endif endfunction function ConfigLoad() File$="config11.txt" if GetFileExists( File$ ) =0 then exitfunction f=OpenToRead(File$) if f Config.FileVersion$=readString (f) Config.PlayerName$ =readString (f) Config.NetworkName$=readString (f) Config.ServerIP$ =readString (f) Config.ServerPort =readinteger(f) Config.BackgroundColor=readinteger(f) Config.BackgroundMaterial=readinteger(f) Config.Board=readinteger(f) Config.Notation=readinteger(f) Config.GridSnap=readinteger(f) closefile(f) endif endfunction
flow/hint for understanding at pc situation: a template file exist at sub folder in your agk project\ media\test.txt here is no test.txt C:\Users\Name\AppData\Local\AGKApps\project\media\ load "test.txt" will load media\test.txt save "test.txt" will save in C:\Users\Name\AppData\Local\AGKApps\project\media\test.txt load "test.txt" will load from C:\Users\Name\AppData\Local\AGKApps\project\media\test.txt