
-----------------------------------
TipsyCzar
Tue Nov 22, 2016 8:54 am

Problem with declaring procedures
-----------------------------------
What is it you are trying to achieve?
Trying to make procedures that call upon each other (Start at a menu, go to a game, back to the menu)


What is the problem you are having?
"'procedure' has not been declared' is the error given

Describe what you have tried to solve this problem
tried re-arranging the order of procedures (obviously didn't work)


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
(This is just a program I created in a few minutes)



var answer:string
var number:int
var guess:int
var x,y,b:int

proc menu
put "Welcome to the main menu. Would you like to play the game?"
get answer
if answer = "yes" then
cls
game
end if
end menu

proc game
put "Click the green box to win. To go back to the menu, click the red box"
drawfillbox (maxx - 25, 0, maxx, 25, red)
drawfillbox (10, 30, 50, 90, green)
loop
mousewhere (x,y,b)
if x = maxx - 25 and y 