If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Moderators: Pete , Mods
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Sun Feb 20, 2005 10:54 am
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?
"But...It was so beutifully done"
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Sun Feb 20, 2005 9:27 pm
Thanks Nate, I thought TIMER was an integer because it returns the seconds from midnight....heh...But thanks!
"But...It was so beutifully done"
{Nathan}
Veteran
Posts: 1169 Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:
Post
by {Nathan} » Mon Feb 21, 2005 9:19 am
It might be, but it still works. Actually... I think it is!
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Mon Feb 21, 2005 10:00 am
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.
"But...It was so beutifully done"
Z!re
Veteran
Posts: 887 Joined: Wed Aug 04, 2004 11:15 am
Post
by Z!re » Mon Feb 21, 2005 10:48 am
Timer is a SINGLE floating point numerical value.
Just like it says in the QB help, if you look under TIMER
I have left this dump.
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Mon Feb 21, 2005 1:26 pm
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.
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055 Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:
Post
by Rattrapmax6 » Mon Feb 21, 2005 2:27 pm
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..
-Kevin (aka:Rattra)
(x.t. r.GRA PHICS )
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Mon Feb 21, 2005 2:50 pm
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?
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055 Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:
Post
by Rattrapmax6 » Mon Feb 21, 2005 3:50 pm
QB Help has 3 Layers,. :Quick Screen: :Discrition: :Example:
Z!re might be on a diff page about TIMER
-Kevin (aka:Rattra)
(x.t. r.GRA PHICS )
Mitth'raw'nuruodo
Veteran
Posts: 839 Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:
Post
by Mitth'raw'nuruodo » Mon Feb 21, 2005 4:52 pm
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.
"But...It was so beutifully done"