View Full Version : code help please
GoOgLe
02-11-2009, 12:15 AM
i have this code on a button click and it set value to ini file but if i leave input dialog empty then i get that (C stack overflow) error next time i run the app...
button click code:
if getrefreshtime ~= nil then
strNum = String.ToNumber(String.Replace(getrefreshtime.Disp layed, " ", "", false));
INIFile.SetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time", strNum);
strNum = strNum * 1000
timer2 = Timer.StartTimer("Plugin2", 101, strNum);
end
jassing
02-11-2009, 04:19 PM
When you say "next time you run the app" do you mean you shut the exe down and then reopen it? or next time you press the button?
Try stopping the timer before you close the exe. (just a guess)
GoOgLe
02-11-2009, 04:23 PM
yes i shut down the exe and reopen it... it writes to ini file like that if i leave dialog input empty
[RefreshTime]
time=0
and when it is "time=0" then i get error but if it is "time=" the i dont...
GoOgLe
02-15-2009, 08:16 AM
when it is "time=0" in ini file then i get error but if it is "time=" the i dont... i have this code but if i leave dialog empty it set that data to ini file "time=0" ???
Button Click Code :
if getrefreshtime ~= nil then
strNum = String.ToNumber(String.Replace(getrefreshtime.Disp layed, " ", "", false));
INIFile.SetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time", strNum);
strNum = strNum * 1000
timer2 = Timer.StartTimer("Plugin2", 101, strNum);
end
Page On Show Code :
strNum = String.ToNumber(INIFile.GetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time"));
Inı File Data :
[RefreshTime]
time=0
Timer Plugin Code :
strNum = String.ToNumber(strNum);
if strNum == 0 then
Page.StopTimer(); else
url = Input.GetText("AddressTxt");
if url == "" then
Page.StopTimer(); else
IExplorer.Navigate("Plugin1", url);
count=count+1
Input.SetText("Input1", count);
end
end
GoOgLe
02-15-2009, 02:27 PM
i attached the apz file... can some one help with that please ?
rexzooly
02-15-2009, 02:43 PM
I am getting no errors at all....... can u screen shot them no errors no nothing here:huh
GoOgLe
02-15-2009, 02:52 PM
does it function ? is it working fully ???
rexzooly
02-15-2009, 03:04 PM
well i get no errors if it live it 0 or blank so no errors you should your leving it blank as there is spacebars there it so its not "" its " " maybe thats your problem:huh
GoOgLe
02-15-2009, 03:47 PM
no it doesnt refresh !!! there is something wrong with code but i couldnt figure out !!!
rexzooly
02-15-2009, 04:34 PM
i will look if i have time later:yes
GoOgLe
02-19-2009, 03:47 AM
i still need hepl with that... it doesnt work i dont understand why ???
Download (http://www.indigorose.com/forums/attachment.php?attachmentid=7778&d=1234729616)
Desrat
02-28-2009, 02:51 PM
works fine for me too, although you could change
if getrefreshtime ~= nil then
strNum = String.ToNumber(String.Replace(getrefreshtime.Disp layed, " ", "", false));
INIFile.SetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time", strNum);
strNum = strNum * 1000
timer2 = Timer.StartTimer("Plugin2", 101, strNum);
end
To this so if its 0 it will always write it as a blank string
if getrefreshtime ~= nil then
strNum = String.ToNumber(String.Replace(getrefreshtime.Disp layed, " ", "", false));
if strNum == 0 then
INIFile.SetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time", "");
else
INIFile.SetValue("AutoPlay\\Docs\\options.ini", "RefreshTime", "time", strNum);
end
strNum = strNum * 1000
timer2 = Timer.StartTimer("Plugin2", 101, strNum);
end
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.