View Single Post
01-10-10, 03:21 PM   #28
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by opismahname View Post
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.

Last edited by ravagernl : 01-10-10 at 03:24 PM.
  Reply With Quote