|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Question about setting an Attribue/property
Lets say I have an attirube/property "A" and a changing attribute "PropertyName" and I want to set that attribute based on another attribue for instance. Let's use an options menu for true or false settings.
Setting = GetProperty("A",false) PropertyName = "A" I then want to say Property = !setting (but I want property to set the value of "A" not property) is this possible? |
#2
|
||||
|
||||
You mean like this:
Code:
prop1 = GetProperty("prop1", false) prop2 = SomeRandomPropertyName() SetProperty(prop2, not(prop1)) |
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
You mean you want a dynamically named attribute to be set to the value of a property? I don't know how to do dynamically named attributes. That or I'm still not sure what you're going for
|
#5
|
||||
|
||||
Attributes and properties are two completely different concepts. Properties are configuration data that persists from one session to another; they're accessed via the GetProperty and SetProperty API methods.
Attributes are temporary variables for storing arbitrary data within a session. They're declared using Attribute widgets and accessed just by using their name in an expression. Since an attribute can contain any data you like, it can of course contain the value you get back from a call to GetProperty. Similarly, you can pass any arbitrary value to SetProperty, including the value of an attribute. But that's true of any expression; there's nothing special about the relation between attributes and properties. If what you're looking for is a way to store a collection of related values indexed by name (instead of by number), a low-tech way to achieve that is with a case statement (as I pointed out in a previous thread). A better approach would be to use a Hashtable or HashMap. If that's not what you're looking for, maybe you could explain in more detail what you're trying to accomplish, and somebody can then suggest a better way of doing it.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question regarding device name property | mskitty666 | SageTV Software | 6 | 10-13-2009 07:26 PM |
When setting or getting property | PLUCKYHD | SageTV Studio | 19 | 05-12-2009 03:04 PM |
Favorite setting question. | bbig119 | SageTV Software | 2 | 09-26-2007 08:52 PM |
Property setting to reconstruct a graph? | Kirby | Hardware Support | 0 | 06-05-2006 06:05 PM |