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 / Help with sync commands

Author
Message
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 24th Feb 2005 11:57
I have used sync on, and sync commands before. I still have no idea why my code wont work. Its a simple code to make a box on the screen that is white. the code is

sync on : sync rate 60
ink rgb(255,255,255),rgb(0,0,0)
box 0,0,600,400
sync
wait key

If I remove the sync parts it works just how i wanted it to.
I assume that with a sync rate of 60 it refreshes it and then clears the screen too fast. If I put the box and sync commands into a loop it works just fine. Is there a way to use sync when it is not in a loop?

Aku Soku Zan
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 24th Feb 2005 12:23
you can use sync not in a loop just to update the screen when loading stuff

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 24th Feb 2005 12:26
Can you provide an example? For some reason the code I posted above won't work for me. I have used the commands before, but I always used sync in a loop.

Aku Soku Zan
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 24th Feb 2005 21:47 Edited at: 24th Feb 2005 21:49
Your code did actualy work...for the minutest part of a second !... the screen was updated but then it got to the 'wait key' part and then waited...

when you have sync on you need to constantly update the screen, so your code would become.


*edit*
in case you didnt know 'scancode()' returns the value of a key pressed on the keyboard..for a list of the keys see the attachment to this post.
So until you press something the 'scancode()' returns nothing, then when you press a key it returns a number, which is greater than zero so the loop ends.

Did that help ?

Attachments

Login to view attachments
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 25th Feb 2005 03:19
This is a known bug. Put an extra sync in before wait key and watch what happens


"Lets migrate like bricks" - Me
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 25th Feb 2005 03:49
Oh...ok, i didnt know that !
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 27th Feb 2005 08:45
Thanks for your reply, I have used the command may times, but always in a main loop for my programs. I know about the scancode() command, but i was just wanting to know a bit more about the sync commands. It seems to update the screen 1 time and is supposed to update the screen time according to the sync rate every second or so.

Aku Soku Zan

Login to post a reply

Server time is: 2024-11-27 23:33:45
Your offset time is: 2024-11-27 23:33:45