Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Calculating with a draw text
Author Message
WooFerPPK

Posted: 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:

Tony

Posted: Fri Nov 22, 2002 3:09 am   Post subject: (No 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)
Tony's programming blog. DWITE - a programming contest.
WooFerPPK

Posted: Fri Nov 22, 2002 3:27 am   Post subject: (No subject)

thanks a million
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: