HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Yay I understand basic JASS, but...

02-23-2003, 06:50 PM#1
FyreDaug
I still need help with Local Variables, I know it should be fairly simple, but I still don't see the advantages of them besides saving a little memory.

What I want to know is,
-how to define a local compared to a gloabal (if anything)
-how to refer to a local variable
-advantages....
02-23-2003, 08:47 PM#2
AIAndy
locals are defined by
local integer my_name = 0
integer can be replaced by any other types, my_name is the chosen name. You can use any other name here too. The initialization part is optional.
You can refer to it by that name.
The advantage of a local compared to a global is that you do not need to declare it in the graphic interface of WE, you can be sure that the value is not influenced by another function and you can reuse the name in other functions without complications.