Originally Posted by opismahname
And how do i make the name of the buff to a string when its active, and to a nil when its not active?
It seems to be hopless for me to begin making addons, this is to hard :S
|
A string is a variable wich holds a number of characters between two symbols, wich in lua, and many other programming languages, are denoted by quotes. Therefore, "test" and 'test' are both strings. When you are using a control syntax, like if then end, the variable get's converted to a boolean. A boolean means: true, or false. Power on, power off.
Code:
a = 'test'
b = "test"
'print a' will put test in your chatframe. 'print b' will do the same. However, when you pass it to a control mechanism, it gets converted to a boolean:
'print (a == b)' will give you the number 1 in the chat frame. Why? Because a chat frame or console can only accept strings to display.