View Full Version : Question about variables

05-01-2012, 11:31 PM
I'm a beginner using Alice 2.2 and I was trying to find information about global variables. In older posts on this forum I read that variables are global and can be used by any method, but whenever I create a variable I get a dialog box stating the variable is local only. So, I'm confused. Can variables be global in Alice (more specifically Alice 2.2) and if so, how do I create them?

05-02-2012, 12:56 AM
You are more than likely creating your variables in the wrong area. Click on "world" in your object list (located on the left hand side of your screen). Then below the object list there are three tabs, properties, methods and functions. The tab you want is properties, once you click the "properties" tab, a button will appear that reads "create new variable". Well you create your variable here while being clicked on "world" inside your object list, which then makes the variable "global" (allowed to be used in any method/function)

05-02-2012, 04:42 AM
Indeed I have been creating my variables in the wrong place to make them global. I greatly appreciate the assistance sfunk. Thank you for your quick response! :D