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 / Couple of n00b questions

Author
Message
Clownpaint
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location: London, England
Posted: 8th Apr 2004 18:50
I just need to sort out a couple of things i dont completely understand so i can sleep at night...

1) what does wrapvalue() do?

2) when should you use the sync command if you are updating the screen manually?
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 8th Apr 2004 19:19
1. From the dbp help
Quote: "This command will return a value that does not exceed the range of 0 to 360. Where a value is specified that exceeds this range, the command will wrap the value around to bring it back within the range. This command is best understood by using the number of a clock as a mental picture of how a number wraps. If the clock hand points to 11 and is then advanced 2 hours, the number has to wrap from 12 around to 1 to keep the cycle going."


Some code that shows it in action, use up arrow to increase angle and down arrow to decrease it.


2. Whenever you want the screen to update
Typically once every loop.

you ain't the cops
Maelstrom
20
Years of Service
User Offline
Joined: 24th Feb 2004
Location: United Kingdom
Posted: 8th Apr 2004 19:19
1 This command will return a value that does not exceed the range of 0 to 360. so 350 + 20 would normally be 370. With Wrapvalue the returned value would be 10.

2.The sync command is used whenever u want to update the screen. Generally on basic applications this would be at the end of your main programme loop after you’ve moved all your graphics. On more complicated games I would say that the sync command is performed at a timed interval. This allows the calculations or physics of your game to run much quicker.
Clownpaint
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location: London, England
Posted: 8th Apr 2004 19:33
Thanks, i can finally sleep at night
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Apr 2004 19:38
not yet:

the dbp function WrapValue has a confirmed bug. If you pass values over 36000+ into it it blows up and returns 0 no matter what you pass in above 36000.

Use this in your code instead, and call it like you would wrapvalue()


you can thank IanM for that code



Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Maelstrom
20
Years of Service
User Offline
Joined: 24th Feb 2004
Location: United Kingdom
Posted: 8th Apr 2004 19:45
@CattleRustler. Didn't know that one. Thanks
Clownpaint
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location: London, England
Posted: 8th Apr 2004 23:49
Quote: "not yet:"


well technically that was wrong.. because you told me how to solve the problem.. so actually i can sleep!

Thanks for that anyway, and thanks to IanM for the solution.

Login to post a reply

Server time is: 2024-09-22 04:19:36
Your offset time is: 2024-09-22 04:19:36