Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

MCom.stringVarToGetFunc

From WoWWiki

Jump to: navigation, search
 

This article is a part of the documentation of the MCom function library

 --[[
   stringVarToGetFunc ( string varString )
     Accepts a variable as a string, and returns a function that
     returns the value.
     However this can parse complex variable names that contain .
     such as "Something.Variable"
     
     This is a lot like getStringVar.  However, getStringVar has to
     generate several objects that will need to be garbage
     collected.  The function returned by stringVarToFunc does
     not generate any amount of GCs worth worying about.  So if
     you are needing to do this very often, like OnUpdate, then
     it is best to use this function to convert to a function,
     and simply call that functin to get the data you need.      
     
     It does not handle "Something['Variable']".. Just use the .
     format instead.  This also works for number indexes.
   
   Args:
     varString - the variable to get, encapsulated in a string, ex:
     "Something.Variable.Monkey.Hippo"
  
   Returns:
     a function that when called will return the data in the passed variable
 ]]--
Rate this article:
Share this article: