Computer Science Canada Problems with GUI.Disable |
Author: | Conagher [ Sun Dec 27, 2015 11:08 pm ] | ||
Post subject: | Problems with GUI.Disable | ||
What is it you are trying to achieve? Hi i am having some problems clearing my GUI off the screen. Im trying clear them so they wont muck up my other GUI. What is the problem you are having? I am putting GUI.Disable (buttonX) and it tells me button X has not been declared. As far as i know i am creation buttons properly and this should not happen Describe what you have tried to solve this problem I have tried messing with the buttons and using GUI.hide instead of GUI.disable but none of my attempts worked. Not really sure whats going on here. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Here is the Code i am having problems with. My goal is to have a working game however i cannot continue if this is not solved. Hope you guys can help me out!
Please specify what version of Turing you are using I am using Turing 4.1.1 |
Author: | Jeffmagma [ Tue Dec 29, 2015 11:47 am ] |
Post subject: | RE:Problems with GUI.Disable |
Your button is not global, its a variable only inside titlescreen, so a GUI.Dispose outside titlescreen won't recognise it. Also, instead of body (procedureName), you could use body proc (procedureName). I think the only difference is that F2 still indents it And why are you forwarding procedures? |
Author: | Conagher [ Tue Dec 29, 2015 2:30 pm ] |
Post subject: | RE:Problems with GUI.Disable |
how do i make the variable global? |
Author: | Insectoid [ Tue Dec 29, 2015 2:48 pm ] |
Post subject: | RE:Problems with GUI.Disable |
A variable declared inside a procedure, function, loop, etc. is called a 'local variable'. It cannot be used outside the block in which it is declared. A variable declared outside of any procedure or loop or whatever is called a global variable and it can be accessed anywhere in the code. Your button variables are declared inside procedures, which makes them local variables. |