replace a variable with the value of another variable

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Sun May 06, 2012 12:19 am
bob offline
User avatar
Posts: 500
Joined: Jun 14, 2006

replace a variable with the value of another variable

I run the first line in this script I get a value of 23 but when I run them once after the other, the second line gives an error;

Code: Select all
prevAlertTemp = indigo.variables[77213772]
indigo.variable.updateValue(794594968, prevAlertTemp)


>>> prevAlertTemp = indigo.variables[77213772]
>>> indigo.variable.updateValue(794594968, prevAlertTemp)
Traceback (most recent call last):
File "<console>", line 1, in <module>
ArgumentError: Python argument types in
VariableCmds.updateValue(VariableCmds, int, Variable)
did not match C++ signature:
updateValue(_VariableCmds {lvalue}, boost::python::api::object elem, CCString value)


Can you tell me what's wrong?

thanks!

Posted on
Sun May 06, 2012 11:09 am
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: replace a variable with the value of another variable

This:

Code: Select all
prevAlertTemp = indigo.variables[77213772]

returns an Indigo variable instance. It contains an Indigo value attribute, but it is more than just a value it is the entire Indigo variable object including: name, value, folder, etc.

To access the value, you'll will then want to use:

Code: Select all
prevAlertTemp.value

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests