From: Johan B. <lis...@ce...> - 2014-01-20 18:42:16
|
Thank you! This is exactly what I needed. :-) Cheers, Johan. Quoting Eloy Paris <pe...@ch...>: > Hi Johan, > > On 01/20/2014 10:23 AM, Johan Braeken wrote: > >> Hi, >> >> >> I have the following problem and I'm not sure how to solve it: >> >> >> My MisterHouse installation consists of several objects, $object1, >> $object2, etc... >> >> I have some code that will output a name of one of these objects, ex: >> $the_object = "object1". >> >> Obviously, I can not do "$the_object->set_state(on);" >> >> >> Is is possible to manipulate an object, when the only thing I have is >> a variable with the name of the object? > > Try using the get_object_by_name() global function, e.g. > > $the_object = get_object_by_name("object1"); > $the_object->set_state(on); > > Cheers, > > Eloy Paris.- > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 |