Page 1 of 1

Problems saving tables in files

Posted: Mon May 25, 2020 2:01 pm
by Juan Carlos
I have this code to save several dates from one table inside of one file called iConecta.prefs:
saveconfigtable[0]=Lengua$
saveconfigtable[1]=Skin$
saveconfigtable[2]=Sonido$
saveconfigtable[3]=Time$
saveconfigtable[4]=DestinoOWB$
saveconfigtable[5]=AskCookie$
OpenFile(1, "iConecta.prefs", #MODE_WRITE)
WriteTable(1, saveconfigtable)
CloseFile(1)

The problem is when I save several times the file if I make a change the contiguous fields instead of to save the current valour, are save with an empty string or the field not is possible read.
I tryed to again give the field valour before to upload but the problem continue, I see that this problem with two fields don't exist.
Where is the problem?

Re: Problems saving tables in files

Posted: Mon May 25, 2020 7:55 pm
by plouf
but this is only part of your code .
how do we know that is not a problem in your program? like saving a 0 character and reading back strings , creating the problem ?

also hollywood has saveprefs and loadprefs which maybe a more proprietary way to do it

Re: Problems saving tables in files

Posted: Tue May 26, 2020 11:25 am
by Juan Carlos
The strange is that this routine save the table fine when I call to save function but now the same routine has the problem even with two fields, I reinstalled the Hollywood for Windows and nothing the problem continue, perhaps I have test you suggestion of LoadPrefs, but I want know the problem because this limit very much using sae the table for other things. :?:

Re: Problems saving tables in files

Posted: Tue May 26, 2020 1:37 pm
by Juan Carlos
I found the problem although it is very mysterious the problem was in one of fields from the table, it had different name in save function and in main declaration and initialized, but here is the strange in previous versions of my program it works fine and now not.
Thank you for your help.