Save / Load Variables - Forum

Forum Navigation
You need to log in to create posts and topics.

Save / Load Variables

Hi All,

What is the simplest way to save variables and load them ?

I would like to do as on visualNeo win to store settings  in a file.
FileWrite "[pubdir]mysettings.txt" "1" "[myvariable1]"
FileWrite "[pubdir]mysettings.txt" "2" "[myvariable2]"
to save the settings in the same directory as the application

and then to read the settings.
FileRead "[pubdir] mysettings.txt " "1" "[myvariable1]"
FileRead "[pubdir] mysettings.txt " "2" "[myvariable2]"

Does anyone has a example to do this ?

Very best,

Hi @otc66,

Due to security restrinctions on WebBrowsers there are not FileWrite and FileRead actions on VisualNEO Web.
You should use LocalStorage instead: click here to read the documentation, (additional LocalStorage information) or neoPhpFileWrite and neoPhpFileRead for saving and reading files on a remote server.

Best regards.

OTC66 has reacted to this post.
OTC66

WARNING: It's important to notice here that Internet Explorer doesn't support LocalStorage.
VisualNEO Web uses Internet Explorer internally when running a project from the Run button, so you should test your app with any other modern browser instead, if you want to use LocalStorage commands.

OTC66 has reacted to this post.
OTC66

Attached is a very interesting sample App from Gaev Keeka showing how to use LocalStorage in combination with JSON objects to store, modify and retrieve complex data locally between sessions. Thanks @gaev !

Uploaded files:
  • You need to login to have access to uploads.
OTC66 has reacted to this post.
OTC66

Thks Luis !

It works fine ..