Computer Science Canada

Calculating with a draw text

Author:  WooFerPPK [ Fri Nov 22, 2002 12:24 am ]
Post subject:  Calculating with a draw text

im stuck, and i cant fiqure out any way to do this here is my program.
Im going to give u my hole program because i might have done somthing worng during it, and plus u need to input numbers. The problem is text := money text is a string and money is an interger, i want to get text to output the calculation of money but wont let me because they are differnt. please help

code:
View.Set ("graphics:786;540,nobuttonbar")
var book, money, late : int
var zero : real
var font1 : int
var fontselect, text : string


fontselect := "Times New Roman:17"
font1 := Font.New (fontselect)
text := "How many books did you take out?"
drawfilloval (maxx div 2, maxy div 2, 175, 60, yellow)
Draw.Text (text, maxx div 2 - 160, maxy div 2, font1, 12)

drawfilloval (maxx div 2, maxy div 2 - 40, 70, 20, red)
locate (27 div 2 + 7, 80 div 2 + 2)
color (white)
colorback (red)
get book

text := "How many days late?"
drawfilloval (maxx div 2, maxy div 2, 173, 60, yellow)
Draw.Text (text, maxx div 2 - 120, maxy div 2, font1, 12)
Font.Free (font1)

drawfilloval (maxx div 2, maxy div 2 - 40, 70, 20, red)
locate (27 div 2 + 7, 80 div 2 + 2)
color (white)
colorback (red)
get late

for decreasing ypos : 195 .. 120 by 5
    drawfilloval (maxx div 2, ypos, 20, 20, 12)
    delay (40)
end for

for decreasing xpos : 390 .. 200 by 5
    drawfilloval (xpos, 120, 20, 20, 12)
    delay (40)
end for

money := book * late

delay (100)
for size : 1 .. money div 10 * 4
    drawfilloval (200, 120, size, size, 9)
    delay (10)
end for


text := money

code:

Author:  Tony [ Fri Nov 22, 2002 3:09 am ]
Post subject: 

here's what you're looking for:

intstr()
and
strint()

both functions convert integer to string and vice wersa. I think that you're looking for STRINT().

so it should be

code:
text:= strint(money)

Author:  WooFerPPK [ Fri Nov 22, 2002 3:27 am ]
Post subject: 

thanks a million


: