Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help my procedures do not work
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wiktor29




PostPosted: Tue Jun 01, 2004 1:37 pm   Post subject: help my procedures do not work

This will not work and I don't know why. Can someone please help.

code:

import GUI
setscreen ("Graphics:max,max")
%Pic.ScreenLoad ("H:/trivia.jpg", 0, 0, picCopy)
var font, font2, font3, line : int
var score : int := 0
font := Font.New ("arial:20")
font2 := Font.New ("arial:12")
font3 := Font.New ("arial:15:bold")
Draw.Text ("LOADING. . .", 300, 200, font, blue)
drawfillbox (400, 150, 630, 168, 102)
%Pic.ScreenLoad ("H:/load.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/load2.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/load3copy.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/5.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/6.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/7.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/8.jpg", 400, 150, picCopy)
delay (500)
%Pic.ScreenLoad ("H:/9.jpg", 400, 150, picCopy)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cls
drawfill (0, 0, 104, 104)
%Pic.ScreenLoad ("H:/trivia2.jpg", 213, 0, picCopy)
line := GUI.CreateLine (213, 0, 213, 700, GUI.EXDENT)
Draw.Text ("Welcome to Toronto Maple  ", 10, 600, font2, 0)
Draw.Text ("Leafs Trivia. Are you a  ", 10, 570, font2, 0)
Draw.Text ("real Leaf fan? Answer ", 10, 540, font2, 0)
Draw.Text ("these questions and ", 10, 510, font2, 0)
Draw.Text ("find out.", 10, 480, font2, 0)
drawfillmapleleaf (25, 30, 190, 200, 0)
drawmapleleaf (26, 31, 189, 199, 7)
drawmapleleaf (24, 29, 191, 201, 0)
Draw.Text ("Toronto", 70, 120, font3, 104)
Draw.Text ("Maple", 78, 100, font3, 104)
Draw.Text ("LEAFS", 75, 80, font3, 104)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure four
   % Pic.ScreenLoad ("H:/l5.jpg", 0, 0, picCopy)
    Draw.Text ("Who is the Leaf captain?", 200, 500, font, 40)
    Draw.Text ("Gary Robers", 350, 350, font, 40)
    Draw.Text ("Brian McCabe", 350, 250, font, 40)
    Draw.Text ("Matts Sundin", 650, 350, font, 40)
    Draw.Text ("Ed Belfour", 650, 250, font, 40)

    var b41 : int := GUI.CreateButton (300, 350, 0, "A", four)
    GUI.SetColor (b41, 102)
    var b42 : int := GUI.CreateButton (300, 250, 0, "B", four)
    GUI.SetColor (b42, 102)
    var b43 : int := GUI.CreateButton (610, 350, 0, "C", four)
    GUI.SetColor (b43, 102)
    var b44 : int := GUI.CreateButton (610, 250, 0, "D", four)
    GUI.SetColor (b44, 102)

end four
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc right3
    score := score + 1
    four
end right3
proc wrong3
    four
end wrong3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc three
    %Pic.ScreenLoad ("H:/l5.jpg", 0, 0, picCopy)
    Draw.Text ("What is Ed Belfour number?", 200, 500, font, 40)
    Draw.Text ("31", 350, 350, font, 40)
    Draw.Text ("13", 350, 250, font, 40)
    Draw.Text ("20", 650, 350, font, 40)
    Draw.Text ("21", 650, 250, font, 40)

    var b31 : int := GUI.CreateButton (300, 350, 0, "A", wrong3)
    GUI.SetColor (b31, 102)
    var b32 : int := GUI.CreateButton (300, 250, 0, "B", wrong3)
    GUI.SetColor (b32, 102)
    var b33 : int := GUI.CreateButton (610, 350, 0, "C", wrong3)
    GUI.SetColor (b33, 102)
    var b34 : int := GUI.CreateButton (610, 250, 0, "D", right3)
    GUI.SetColor (b34, 102)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end three
proc right2
    score := score + 1
    three
end right2
proc wrong2
    three
end wrong2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure two
    %Pic.ScreenLoad ("H:/l5.jpg", 0, 0, picCopy)
    Draw.Text ("Who is the Leaf captain?", 200, 500, font, 40)
    Draw.Text ("Gary Robers", 350, 350, font, 40)
    Draw.Text ("Brian McCabe", 350, 250, font, 40)
    Draw.Text ("Matts Sundin", 650, 350, font, 40)
    Draw.Text ("Ed Belfour", 650, 250, font, 40)

    var b21 : int := GUI.CreateButton (300, 350, 0, "A", wrong2)
    GUI.SetColor (b21, 102)
    var b22 : int := GUI.CreateButton (300, 250, 0, "B", wrong2)
    GUI.SetColor (b22, 102)
    var b23 : int := GUI.CreateButton (610, 350, 0, "C", right2)
    GUI.SetColor (b23, 102)
    var b24 : int := GUI.CreateButton (610, 250, 0, "D", wrong2)
    GUI.SetColor (b24, 102)
end two
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc right
    two
    score := score + 1
end right
proc wrong
    two
end wrong
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure one
   % Pic.ScreenLoad ("H:/l5.jpg", 0, 0, picCopy)
    Draw.Text ("What year did the leafs win the stanley cup last?", 200, 500, font, 40)
    Draw.Text ("2000", 350, 350, font, 40)
    Draw.Text ("1967", 350, 250, font, 40)
    Draw.Text ("1976", 650, 350, font, 40)
    Draw.Text ("1997", 650, 250, font, 40)

    var b1 : int := GUI.CreateButton (300, 350, 0, "A", wrong)
    GUI.SetColor (b1, 102)
    var b2 : int := GUI.CreateButton (300, 250, 0, "B", right)
    GUI.SetColor (b2, 102)
    var b3 : int := GUI.CreateButton (610, 350, 0, "C", wrong)
    GUI.SetColor (b3, 102)
    var b4 : int := GUI.CreateButton (610, 250, 0, "D", wrong)
    GUI.SetColor (b4, 102)
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end one
var start : int := GUI.CreateButton (600, 20, 0, "START", one)
GUI.SetColor (start, 102)
var quitBtn : int := GUI.CreateButton (750, 20, 0, "QUIT", GUI.Quit)
GUI.SetColor (quitBtn, 102)
loop
    exit when GUI.ProcessEvent
end loop
cls
[/code]
Sponsor
Sponsor
Sponsor
sponsor
SuperGenius




PostPosted: Tue Jun 01, 2004 2:39 pm   Post subject: (No subject)

The error i got is "setcolour is not in the export list of GUI", but I have 4.04, so i dont know if it is a .05 feature. However, you have code, procedures and then more code. it is best if you put all of your procedures at the top of the program, before any code that is not contained in a procedure. In some cases this causes probems, but sometimes it doesnt. in any case it is considered bad form.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: