Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / time delay help

Author
Message
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 17th Jul 2005 13:15
Two hours ago my code looked great (not working correctly but at least comprehendable), now it's fubar....

I am trying to decrease and/or increase a variable and manipulate the speed at which the variable changes...

example every 2 seconds the variable decreases by x amount etc...

wait & sleep are useless and repeat until is wreaking havoc on my gui...any help would be appreciated....
Leeorg
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 17th Jul 2005 14:22
If your program runs from a central Sub-Routine - you could try this:

All of the above is customisable to your needs, I assume a key-input is needed for altering the CHANGE varible. You can ditch the wait & sleep commands.
For finer control you could CHANGE to CHANGE# so you can increase/decrease by a value which is less then one
Hope this is of use!
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 17th Jul 2005 15:43
hey thanks Leeorg...

not quite what i needed for this particular application but it works for another part of my program...Kudos my friend saved me from posting again...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 17th Jul 2005 15:58
What about something like this? Every 2 secs the variable is increased by the value of x (or 1)



HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 17th Jul 2005 18:46
Here's another one, see if you can you use it.

if val(mid$(str$(timer()),6))>8
rem do something
endif

looks at the timer and checks if a number XXXXXX as reached 8 if it has do something

this it how i made a blink cursor.


I'm not getting you down am I, Ho Look! another fancy Door?
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 18th Jul 2005 17:21
I ended up with something very similar to Lost's version, but I am curious to try yours Howdo....

thanks all
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 19th Jul 2005 05:19
Howdo, I'v never seen it done that way before! Heckno, the time increments by 1000 every second. I think what howdo is trying to do is make it look flashy! Rather than checking if the actual number as incremented by 2000 (2 seconds) it conversts the variable into a string and checks to see if the variable which used to be 6 has now gone into 8. The problem with that code is as timer keeps incrementing, you need to find the 4th from last number, convert that into the screen. It wont always be the 6th character. In my opinion its just a lot easier to check the actual variable rather than converting it. Interesting way of coding tho!

J

Hello!

Login to post a reply

Server time is: 2024-09-23 23:19:33
Your offset time is: 2024-09-23 23:19:33