Hi,
In my gadget I save a value in my VBScript, how do I re-load this saved value I have:
System.Gadget.Settings.Write
"Record", dtmSystemUptimeSecs s = System.Gadget.Settings.Read("Record")But this doesn't seem to work
If my uptime is big interger should I use the writeString & readString methods

Using System.Gadget.Settings
.net sukbir
eg. Using read will return the following incorrect types:
"123" will return the number 123, not the string "123"
"true" will return the boolean value true, not the string "true"
Advantanges of Javascript over VB. Well, you have access to all the HTML trigged values like "event.screenX" for a start. Not to mention having access to the whole HTML structure through getElementByID etc.
In short, Javascript is more suited to web development than VB. You'll still need VB here and there, such as presenting dialogues to users, because MS think they're bad for the user experience (shame they don't apply the same rule to their own software!
kidwidahair
So you're code needs to be changed to:
System.Gadget.Settings.write "Record", dtmSystemUptimeSecs
RecordTime = System.Gadget.Settings.read("Record")
Buddy Funny
I see the value in settings.ini
System.Gadget.Settings.Write
"Record", dtmSystemUptimeSecs time = System.Gadget.Settings.Read(Record)Record.innerText =
"Record: " & timeIf I put this then the "Record: " text dissapears, if I comment out the time = line & the time variable then I see the text.
Do I have to load the settings somehow I don't have a settings.html, I just though you could save values
How big is large for write string
Eddie Garcia
traci779
Ohio Mike
AlGor456
Sub
Times On Error Resume Next Set objLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objLocator.ConnectServer(MachineName, "root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOS in colOperatingSystemsdtmBootup = objOS.LastBootUpTime
dtmLastBootupTime = WMIDateStringToDate(dtmBootup)
dtmSystemUptimeSecs = DateDiff(
"s", dtmLastBootUpTime, Now)Uptime.innerText =
"Uptime: " & SecondsToDateString(dtmSystemUptimeSecs) NextSystem.Gadget.Settings.Write
"Record", dtmSystemUptimeSecsRecordTime = System.Gadget.Settings.Read(
"Record")Record.innerText =
"Record: " & RecordTimesetTimeout
"Times()", 30000End
Subananth prasad
If it's large, you may well need to use readString/writeString
Loonyjuice
System.Gadget.Settings.Write "Record", "100"
sTime = System.Gadget.Settings.ReadString("Record")
Record.innerText = "Record: " & sTime
If it still doesn't work, you've probably come across the disappearing System.* bug (bug#11 on the known bugs list).
Also try rewriting it as Javascript with an error trap:
try{
sTime = System.Gadget.Settings.ReadString("Record");
Record.innerText = "Record: " + sTime;
ivanchain
silverfrost
System.Gadget.Settings.Write "Record", dtmSystemUptimeSecs
time = System.Gadget.Settings.Read("Record")
Record.innerText = "Record: " & CStr(time)
Chimme
What the advantage of Java over VB
When should I use readString over read
Seems fixed now as well
Federico Silberberg
OK, the readstring thing didn't work.
with the JS I get [object Error]