WoW:API GetCVar: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Reformat and expand.)
Line 1: Line 1:
<center>'''GetCVar'''</center>
{{wowapi}} __NOTOC__


GetCVar allows you to get the content of the variables defined in the config.wtf file (which is in the WTF directory).
GetCVar allows you to get the content of the variables defined in the config.wtf file (which is in the WTF directory).


GetCVar("realmName") - returns current realm name.
value = GetCVar("cvarName")


----
== Parameters ==
{{WoW API}}
=== Arguments ===
:;cvarName: String - see [[Config.wtf defaults]] for a list
 
=== Returns ===
:;value: String
 
 
== Example ==
 
  DEFAULT_CHAT_FRAME:AddMessage(GetCVar("realmName"))
 
Outputs your realm name in the chat frame.
 
== Notes ==
 
* Calling GetCVar with an invalid variable name will cause an error

Revision as of 10:30, 31 July 2006

WoW API < GetCVar

GetCVar allows you to get the content of the variables defined in the config.wtf file (which is in the WTF directory).

value = GetCVar("cvarName")

Parameters

Arguments

cvarName
String - see Config.wtf defaults for a list

Returns

value
String


Example

 DEFAULT_CHAT_FRAME:AddMessage(GetCVar("realmName"))

Outputs your realm name in the chat frame.

Notes

  • Calling GetCVar with an invalid variable name will cause an error