PDA

View Full Version : Question about variables


bfry
05-02-2012, 12:31 AM
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?

sfunk
05-02-2012, 01: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)

bfry
05-02-2012, 05: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