Posted: 18th Jun 2007 1:25
Well, I have a timer:

+ Code Snippet
time=timer()-oldtime
oldtime=timer()
finaltime=finaltime+time


now it seems to calculate fine (not 100% accurate, but it works), but whenver I put in code like:

+ Code Snippet
function test()
        if elapser=0
            elapsed=finaltime+15000
            elapser=1
        endif
        if finaltime<=elapsed
            print "Success"
        endif
endfunction


then what happens is that it will diaplay it for a split-second, then the text will disappear, even though I set elapsed to equal the time the function is called plus 15 seconds. The wierd part is, i've set elapsed to finaltime+600000 and it still only shows for a split-second even though that sets it for 10 minutes.
Posted: 18th Jun 2007 2:00
finaltime must be global or passed/returned to/from the function

else it makes a seperate finaltime in the function with value = 0
Posted: 18th Jun 2007 2:08
finaltime is a global, but what do you mean by pass it to the function?
Posted: 18th Jun 2007 2:10
nevermind if it's global you don't have to pass it must be something else
Posted: 18th Jun 2007 2:11
Actually, i'm calling this function from an include file, and the global declaration is in the main source. Would that cause it?
Posted: 18th Jun 2007 2:13
is elapser global too? If not it will always be zero when you enter the function so wont rember its been set to 1.
Posted: 18th Jun 2007 2:22
elapser is global, yes.