News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

WAIT command

Started by Ian Price, January 22, 2006, 12:29:28 AM

Previous topic - Next topic

Ian Price

I don't know if this has been sorted in v1.whatever, but my laptop is running the update before the last major update 1.89? (I've updated my pc, but not lappy).


I tried to use the WAIT command to delay a splash screen for 3 seconds (which according to the help file should be Wait 3000


However, no matter what figure I give to the "Wait" command it just doesn't want to... wait! There does appear to be a slight pause, but not for the specified/required period.

Is this a bug, or have I missed something?
I came. I saw. I played some Nintendo.

kevin

Yes, the HELP wrong.  

You can only wait for a max of 1000 milliseconds.

Ian Price

I came. I saw. I played some Nintendo.

japh42

#3
Hi,
     I've encountered something like this.  I was using the third beginner's lesson "PROJECT : Print_Coloured_Text""
and tried to figure how to make it hesitate between lines and play around with the SYNC command.

As I added WAITs at different points I found that if I added two WAIT 1000s after each of the first two printed lines, it worked fine.  However, if I added them after the printed third line, it would add the time to the WAITs after the second line.
I've added a total of 9 WAITs and its added all that time after the second line and prints the third and fourth lines together.

CODE:

  ; Set the INK colour to BLUE
    Ink RGB(0,0,255)
 
  ; Display the "Hello World" message to the screen in the current ink colour
    Print "Hello World"
    WAIT 1000
    WAIT 1000
    SYNC

  ; Set the INK colour to GREEN
    Ink RGB(0,255,0)

  ; Display the next message to the screen, at a new line
    Print "This is my third program"
    WAIT 1000
    WAIT 1000
    SYNC

  ; Set the INK colour to RED
    Ink RGB(255,0,0)

  ; Display the final message to the screen
    Print "That's all for this lesson"
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    WAIT 1000
    SYNC

  ; Set the INK colour to PURPLE (MIX RED & BLUE)
    Ink RGB(255,0,255)
    Print "Press Any Key To End"
   
  ; Call the SYNC command to show the drawn graphics to the user.
    Sync
 
  ; Tell PB to wait for a Key press before going to the next command
    WaitKey
   
  ; Tell PB to end your program and return to the editor
     End



Sorry but I have no idea how to post code in code windows.   :(

empty

If you want to delay the output of the following lines, you should place WAIT after the SYNC command. Only after you've called sync the printed messages can be seen. So in your example it prints the third line but it's not visible until the SYNC command. But between Print and Sync it will wait 9 seconds.

QuoteSorry but I have no idea how to post code in code windows.
Use the tags [ code]Here goes my code [ /code] (without the spaces)
Or select the text and press the "#" button above the edit field.

; PROJECT : Project1
; AUTHOR  : me
; CREATED : 18.04.2008
; ---------------------------------------------------------------------

  ; Set the INK colour to BLUE
    Ink RGB(0,0,255)

  ; Display the "Hello World" message to the screen in the current ink colour
    Print "Hello World"
    Sync
    Wait 1000
    Wait 1000

  ; Set the INK colour to GREEN
    Ink RGB(0,255,0)

  ; Display the next message to the screen, at a new line
    Print "This is my third program"
    Sync
    Wait 1000
    Wait 1000

  ; Set the INK colour to RED
    Ink RGB(255,0,0)

  ; Display the final message to the screen
    Print "That's all for this lesson"
    Sync
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000
    Wait 1000

  ; Set the INK colour to PURPLE (MIX RED & BLUE)
    Ink RGB(255,0,255)
    Print "Press Any Key To End"
   
  ; Call the SYNC command to show the drawn graphics to the user.
    Sync

  ; Tell PB to wait for a Key press before going to the next command
    WaitKey
   
  ; Tell PB to end your program and return to the editor
     End

japh42

OK,  got it.

At first I just changed the last one and it moved the improper waiting up one step.
After fixing them all it runs fine.

Thanks.