
-----------------------------------
starlight
Sun Apr 24, 2005 9:07 pm

drawfill arc
-----------------------------------
i don't understand why doesn't this command works:


var p:int
p:=(1000 div 2000)*360
drawfillarc (maxx div 2,maxy div 2,15,15,0,p,black)


isnt' this same as this?

drawfillarc (maxx div 2,maxy div 2,15,15,0,180,black)


why doesn't the first cod execute ?

-----------------------------------
Delos
Sun Apr 24, 2005 9:16 pm


-----------------------------------

put p


Value returned is 0.  You're using div.  This does not return real numbers, only integers.

-----------------------------------
starlight
Sun Apr 24, 2005 9:22 pm


-----------------------------------
but if i use 


var p:real
p:=(1000 /2000)*360 
drawfillarc (maxx div 2,maxy div 2,15,15,0,p,black)


 it says the assign value is wrong type. so it there anyway to make p an integer other than use the div function?

-----------------------------------
Bacchus
Sun Apr 24, 2005 9:25 pm


-----------------------------------
round()

-----------------------------------
starlight
Sun Apr 24, 2005 9:30 pm


-----------------------------------
actually i know the round function works but i don't think i can use it in my case because i am trying to make a pie graph. and if i use the round function it rounds 0.5 into one which is not what i want.


var p:int
p:=round(1000 / 2000)*360

drawfillarc (maxx div 2,maxy div 2,15,15,0,p,black)


the 1000 in my program represent the number of times out of 2000 and times 360 degree. so i don't think the round function should be use in my program.

-----------------------------------
Bacchus
Sun Apr 24, 2005 9:35 pm


-----------------------------------
well there also ur problem, by using div it round the number down, making it 0 then multiplying it by 360 which is 0. wat you need to do is find the angle in real then round it. try
var p:int:=round((1000/2000)*360)
drawfillacr(blah)
