Sorry, Again, I need help, Im Such A newb at turing!
Author |
Message |
icedesi
|
Posted: Sun Jan 04, 2004 6:59 pm Post subject: Sorry, Again, I need help, Im Such A newb at turing! |
|
|
Quote:
setscreen ("graphics:800;600")
var xx, yy, bb, aa, cc, dd, ee, ff, gg, hh, ii, jj, kk, ll, mm: int
%Calculator Physical Shape
var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, x, y, z : int
procedure physical
drawbox (100, 200, 450, 470, 1)
drawline (100, 430, 450, 430, 1)
drawbox (107, 435, 443, 465, 1)
drawline (370, 200, 370, 430, 1)
end physical
% Calculator Numbers
procedure button1
drawbox (107, 205, 187, 285, 1)
Text.LocateXY (147,245)
put "1"
loop
mousewhere (xx, yy, bb)
exit when bb = 1 and 107 <= xx and xx <= 187 and 205 <= yy and yy <= 285
end loop
if buttonmoved ("down") then
a:= 1
end if
end button1
procedure button2
drawbox (197, 205, 277, 285, 1)
Text.LocateXY (237,245)
put "2"
loop
mousewhere (cc, aa, dd)
exit when dd = 1 and 197 <= cc and cc <= 277 and 205 <= aa and aa <= 285
end loop
if buttonmoved ("down") then
b:= 2
end if
end button2
physical
button1
button2
This Time, Whenever i Run the program, it turns out that the procedures don't work the way i expect them to, one button comes before the next, and so on, im trying to make a graphical calculator which shows 0-9 and the operatiors + - * / - Engineering Teachers don't teach like they used to, creating Dumb Kids! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Sun Jan 04, 2004 10:23 pm Post subject: (No subject) |
|
|
well the way you have it set up is that there is a loop in the procedure that will stop the progame from contioning intill you click on the buttion. this stops the drawing of the next buttion.
the loop should be some where eltes affter you draw the buttions and it should be one loop that will have serveral if's for each buttion |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
|
|