08-15-2010, 02:43 PM
I wrote a function to transform Speccy frames to a timer:
After calling it often (it shows effect around timecode 0:08), there was a screen memory corruption. In my full program the timer was still working, but the keys did not work anymore, and after that, even the minute display was corrupted. Maybe a overflow?
Reducing the Heap size from default to 100 caused no corrupted screen memory, but a complete crash.
Oh, and I'm using the latest devel version.
Edit:
It looks like there is a leak in the STR function, as without STR my program does not crash after a while.
Code:
function Clock(tim as uinteger) as String
dim secs as Uinteger
dim mins,sec as ubyte
dim s$ as String
s$=""
secs=int(tim/50)
mins=int(secs/60)
sec=secs mod 60
s$=str(sec)
if len(s$)=1 then
s$="0"+s$
end if
return str(mins)+":"+s$
end function
dim a as uinteger
for a=0 to 1000
print at 0,0;Clock(a)
next a
Reducing the Heap size from default to 100 caused no corrupted screen memory, but a complete crash.
Oh, and I'm using the latest devel version.
Edit:
It looks like there is a leak in the STR function, as without STR my program does not crash after a while.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!