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.
sync on
ang as integer
do
cls
if upkey() then inc ang : wait 25
if downkey() then dec ang : wait 25
`draw the line
line 100,100,100+(cos(ang)*50),100+(sin(ang)*50)
`draw the text around line
text 100,50-text height("270"),"270"
text 150,100,"0"
text 50-text width("180"),100,"180"
text 100,150,"90"
text 0,0,"ang :"+str$(ang)
text 0,15,"wrapvalue(ang) :"+str$(wrapvalue(ang))
sync
loop
2. Whenever you want the screen to update
Typically once every loop.
you ain't the cops