simple saving example

Just starting out? Need help? Post your questions and find answers here.
rory
Posts: 11
Joined: Mon Nov 25, 2019 9:05 pm

simple saving example

Post 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
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: simple saving example

Post 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
Christos
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: simple saving example

Post by Peter »

@rory:

you can use the Preferences-Module to load/save Parameter values. The usage is the same as in PureBasic

Greetings ... Peter
Post Reply