
-----------------------------------
donutking
Thu Jan 11, 2007 10:04 pm

Gui
-----------------------------------
Every time i use a GUI Turing annouces a fatal error. What's the problem? :D

-----------------------------------
Prince Pwn
Thu Jan 11, 2007 10:16 pm

RE:Gui
-----------------------------------
At the top of your program, you must:

import GUI


-----------------------------------
donutking
Thu Jan 11, 2007 10:17 pm

Re: Gui
-----------------------------------
i did that already, the error is still there

-----------------------------------
Prince Pwn
Thu Jan 11, 2007 10:19 pm

Re: Gui
-----------------------------------
Post your code or give a better explanation.

-----------------------------------
donutking
Thu Jan 11, 2007 10:22 pm

Re: Gui
-----------------------------------
here's the code, what's wrong?



[/code]
%Variables
import GUI

setscreen ("Graphics")
setscreen ("nocursor")

var key : string (1)
var draw, draw2, draw3, draw4, yes, no, quitGame, v, w, x, y, z : int := 0
var pic : int
var btn, btnupdwn : int

proc title
    cls
    locate (1, 34)
    put "The Ramdom Blocks Game"
    put ""
end title

proc PauseProgram
    put ""
    put "Please press any button to continue:"
    getch (key)
end PauseProgram

proc Game1
    var sqr, sqr2, sqr3, sqr4, sqr5, box, box2, box3, box4, box5 : string
    var mx, my, updown : int
    cls
    drawbox (0, 0, 75, 75, 7)
    drawbox (100, 0, 175, 75, 7)
    drawbox (200, 0, 275, 75, 7)
    drawbox (300, 0, 375, 75, 7)
    drawbox (400, 0, 475, 75, 7)
    var x1, y1, x2, y2, x3, y3, x4, y4, y5, x5 : int
    randint (x1, 0, 25)
    randint (x2, 100, 125)
    randint (x3, 200, 225)
    randint (x4, 310, 335)
    randint (x5, 420, 455)
    y1 := 199
    y2 := 210
    y3 := 220
    y4 := 230
    y5 := 240
    randint (v, 0, 255)
    randint (w, 0, 255)
    randint (x, 0, 255)
    randint (y, 0, 255)
    randint (z, 0, 255)
    drawfillbox (x1, y1, x1 + 50, y1 + 50, v)
    drawfillbox (x2, y2, x2 + 55, y2 + 60, w)
    drawfillbox (x3, y3, x3 + 60, y3 + 70, x)
    drawfillbox (x4, y4, x4 + 65, y4 + 80, y)
    drawfillbox (x5, y5, x5 + 70, y5 + 90, z)
    loop
        if buttonmoved ("down") then
            buttonwait ("down", mx, my, btn, updown)
            if x1 