WoW:API GetNumLanguages: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Fix sample code)
m (Move page script moved page API GetNumLanguages to API GetNumLanguages without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
__NOTOC__
{{wowapi}}
{{wowapi}}


Line 11: Line 12:
=== Returns ===
=== Returns ===


:NumLanguages
;NumLanguages : Numeric - Returns the number of languages your character can speak.


:;NumLanguages : Numeric - Returns the number of languages your character can speak.
== Example ==
 
=== Example ===


  for x=1, GetNumLanguages() do
  for x=1, GetNumLanguages() do
   DEFAULT_CHAT_FRAME:AddMessage(GetLanguageByIndex(x))
   [[API ScrollingMessageFrame AddMessage|DEFAULT_CHAT_FRAME:AddMessage]]([[API GetLanguageByIndex|GetLanguageByIndex(x)]])
  end
  end


== Info ==
== Notes ==
=== for .. do ===
* Currently (v3.0.3) this function returns either 1 or 2. For Humans and Orcs, it returns 1. For all other races, it returns 2.
 
:Look for the 'for .. do' block at the [http://www.lua.org/manual/5.0/ Reference Manual].
 
=== GetLanguageByIndex(index) ===
 
:[[API GetLanguageByIndex|GetLanguageByIndex(index)]] - Returns the language specified by the index.
 
=== DEFAULT_CHAT_FRAME:AddMessage("text",r,g,b) ===
 
:;[[API ScrollingMessageFrame AddMessage|ScrollingMessageFrame:AddMessage("text",r,g,b,id)]] : Valid Frame names:<br>DEFAULT_CHAT_FRAME<br>ChatFrame1 - ChatFrame7

Latest revision as of 04:46, 15 August 2023

WoW API < GetNumLanguages

Returns the number of languages your character can speak.

NumLanguages = GetNumLanguages()

Parameters[edit]

Arguments[edit]

none

Returns[edit]

NumLanguages
Numeric - Returns the number of languages your character can speak.

Example[edit]

for x=1, GetNumLanguages() do
  DEFAULT_CHAT_FRAME:AddMessage(GetLanguageByIndex(x))
end

Notes[edit]

  • Currently (v3.0.3) this function returns either 1 or 2. For Humans and Orcs, it returns 1. For all other races, it returns 2.