Computer Science Canada

GUI.CreateButton in procedure

Author:  Azzy [ Wed Nov 05, 2003 7:22 pm ]
Post subject:  GUI.CreateButton in procedure

i need to make the following code for an rpg i'm making.
code:
procedure stats
put "Strength         ",strength
put "Agility          ",agility
put "Vitality         ",vitality
put "Luck             ",luck
put "Charisma         ",charisma
put "Intelligence     ",intelligence
put "Wisdom           ",wisdom

draw:= GUI.CreateButtonFull (5, 10, 0, "Strength",
            strength2, 0, '^D', true)
draw:= GUI.CreateButtonFull (85, 10, 0, "Agility",
            agility2, 0, '^D', true)
draw:= GUI.CreateButtonFull (155, 10, 0, "Vitality",
            vitality2, 0, '^D', true)
draw:= GUI.CreateButtonFull (230, 10, 0, "Luck",
            luck2, 0, '^D', true)
draw:= GUI.CreateButtonFull (290, 10, 0, "Charisma",
            charisma2, 0, '^D', true)
draw:= GUI.CreateButtonFull (375, 10, 0, "Intelligence",
            intelligence2, 0, '^D', true)
draw:= GUI.CreateButtonFull (470, 10, 0, "Wisdom",
            wisdom2, 0, '^D', true)           
stat:=strength+agility+vitality+luck+charisma+intelligence+wisdom
if stat<=70 then
cls
stats
else
end if
end stats


i need it to keep running the program until all of the stats=70.but when i do a loop it doesn't let you press the buttons, and when i try delay it still won't let you touch the buttons.can some one help me?

Author:  Tony [ Thu Nov 06, 2003 9:53 am ]
Post subject: 

You're missing GUI.ProcessEvent

You need that run in a loop for GUI to work.

Author:  Andy [ Fri Nov 07, 2003 11:32 pm ]
Post subject: 

inside a loop


: