Page 1 of 1
simple saving example
Posted: Sun Apr 19, 2020 9:06 am
by rory
can someone please give me an example of how to save the value "level" to a local file and load it, also side question, is it possible to save files on the server where the sb application is, if so how do I do this?
I know this is a stupid question, I don't know much spiderbasic yet and the callbacks really confused me
Re: simple saving example
Posted: Sun Apr 19, 2020 11:43 am
by plouf
dont understand what you mean by "value 'level'"
anyway spiderbasic apps running inside a browser so you dont actualyl have access to system files
(file library need interaction from user)
if you just want to save local some data you can use COOKIES or database
database is the best option, however you should keep in mind that user may "cleanup data" at any time

(database library has example)
as for question in server
HTTPRequest() is the command that sends "data" via POST/GET request and you get back from server data
proper server side script shoudl evaluate data and send back.
PHP or so script must run in server waiting your requests
Re: simple saving example
Posted: Sun Apr 19, 2020 12:09 pm
by Peter
@rory:
you can use the
Preferences-Module to load/save Parameter values. The usage is the same as in PureBasic
Greetings ... Peter