QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Jack002 on April 09, 2019, 10:35:11 pm

Title: Small bug in help for TIMER
Post by: Jack002 on April 09, 2019, 10:35:11 pm
I'm new to reporting bugs, this one is a baby knat. I see a bugs area here, I have no provision to post there, so someone FW this to the right location.

I'm using QB64 V1.2. I love it. I'm learning more commands, was looking at timer and delay
When you open HELP and go to TIMER, there is a sample program in it (these are so helpful, I copy these into the IDE and play with them all the time)
This one has a small problem:

DO
  PRINT "Hello";
  Delay .5  'accuracy down to .05 seconds or 1/18th of a second in Qbasic
  PRINT "World!";
LOOP UNTIL INKEY$ = CHR$(27) 'escape key exit

Delay is there without the leading _.
I figured it out for myself, but thought I'd mention it. No big deal.

Thanks
Jack
Title: Re: [not really a bug] Small bug in help for TIMER
Post by: FellippeHeitor on April 09, 2019, 11:46:42 pm
Here's the full example in the TIMER help/wiki page:

Code: QB64: [Select]
  1.  
  2.   PRINT "Hello";
  3.   Delay .5  'accuracy down to .05 seconds or 1/18th of a second in Qbasic
  4.   PRINT "World!";
  5. LOOP UNTIL INKEY$ = CHR$(27) 'escape key exit
  6.  
  7.  
  8. SUB Delay (dlay!)
  9. start! = TIMER
  10. DO WHILE start! + dlay! >= TIMER
  11.   IF start! > TIMER THEN start! = start! - 86400
  12. END SUB  
  13.  

This code exemplifies creating a custom SUB Delay (last half of the code block) which uses TIMER, so it's not really a bug.
Title: Re: Small bug in help for TIMER
Post by: Jack002 on April 10, 2019, 11:58:14 am
Oh I see! I saw those as separate.
My mistake. Thanks.