Page 1 of 1

TIMER Delays

Posted: Sun Feb 20, 2005 10:54 am
by Mitth'raw'nuruodo
Ok, here's what I know:

Code: Select all

Seconds = 1
timeI = TIMER
DO : LOOP UNTIL timeI + Seconds <= TIMER
That code will delay for 1 second.

Now here's my question:

How do you make it delay for <1 second? If you make Seconds <1 then won't it still delay for 1 second? :?

Posted: Sun Feb 20, 2005 11:06 am
by {Nathan}
Ohh! Thats sooo easy! Just make you vars !s (the defualt) and change them to decimals :!:

here is a tutor: http://petesqbsite.com/sections/tutoria ... e_lift.txt

Pete, you da man!

Posted: Sun Feb 20, 2005 9:27 pm
by Mitth'raw'nuruodo
Thanks Nate, I thought TIMER was an integer because it returns the seconds from midnight....heh...But thanks! :D

Posted: Mon Feb 21, 2005 9:19 am
by {Nathan}
It might be, but it still works. Actually... I think it is!

Posted: Mon Feb 21, 2005 10:00 am
by Mitth'raw'nuruodo
No, if it was then it wouldn't work...

Use this code to find out:

Code: Select all

DO
   PRINT TIMER
LOOP WHILE INP(96) <> 129  'if the ESC key has gone up then exit do
As you see TIMER has two decimal places with it. So TIMER is not an integer.

Posted: Mon Feb 21, 2005 10:48 am
by Z!re
Timer is a SINGLE floating point numerical value.

Just like it says in the QB help, if you look under TIMER

Posted: Mon Feb 21, 2005 1:26 pm
by Mitth'raw'nuruodo
No it doesn't.

I looked before I posted this, and I double checked after you posted that and it says nowhere in the QB help that TIMER is a floating point single precision type variable.

Hence this topic.

Posted: Mon Feb 21, 2005 2:27 pm
by Rattrapmax6
Um, Mitth, arn't "31.123" what you call a floating point.. so that makes TIMER a floating point.. ^^ Or thats what TIMER returns for me.. :)

Posted: Mon Feb 21, 2005 2:50 pm
by Mitth'raw'nuruodo
I know its floating point.....and your right....so uh?

What's that about?

I said It doesn't because QB help says nothing about floating point, I assumed that since it said # of seconds from midnight, it ment an integer...

But then I checked it out and its not so your right it is a floating point but Z!re said that QB help said it was and I said it doesn't cause it doesn't, clear now, eh? :D

Posted: Mon Feb 21, 2005 3:50 pm
by Rattrapmax6
:) QB Help has 3 Layers,. :Quick Screen: :Discrition: :Example:

Z!re might be on a diff page about TIMER :wink:

Posted: Mon Feb 21, 2005 4:52 pm
by Mitth'raw'nuruodo
No.

QuickScreen: Details: Example: Contents: Index

I looked at all three of them and it never says TIMER is a SINGLE precision floating-point decimal type variable. I does however say it indirectly when in the example it shows Start! = TIMER.

Now start! is a single precision. So therefore TIMER is a single precision indirectly. But it never says it directly.