This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

JV access to Storage
#1
Hi, 
I know that you are working at simpler using js in visualization. Unfortunately I use HL instead of LM, so that update isn't for me. 

So i have a question: how to get access to variable storage memory, saved by lua script command storage.get/storage.set.

I found that you have some command, storage, but p.storage.get didn't get any data from variable saved by lua. any suggestions? I want to save data from visualization dynamically.
Reply
#2
Current stable version does not provide any method of getting storage variables from JavaScript, it's not even sent in any way.
Reply
#3
maybe You have some idea how to save variable containing table, from js, of course on HomeLYnk.
Reply
#4
Another approach is to use "255 byte string" object data type, should be enough in most cases.
Reply
#5
@admin

Would it be possible to use os.execute('echo %s >> /home/ftp/myfile.txt', mystring) to do this and then parse myfile?
With os commands you can also access the variables in the following location:  /var/gs-storage/nameofmyvariable

Have this script run every minute, then create a file on user ftp space. On some action parse it and show in a iframe or something.
Reply
#6
writing file to LM/HL can be done easily by:


Code:
io.writefile(filename, text_of_file)
or read:



Code:
local f = assert(io.open(filename, "r"))
local t = f:read("*all")


but how write/read this file from javascript?

ps. great idea Sandstrand Smile
Reply


Forum Jump: