SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2009, 12:55 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
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?
Reply With Quote
  #2  
Old 08-25-2009, 02:18 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
You mean like this:
Code:
prop1 = GetProperty("prop1", false)
prop2 = SomeRandomPropertyName()
SetProperty(prop2, not(prop1))
I think that should work... Though I don't remember if you can use the bang (!) to negate, or if there's a "not" keyword, or if you're going to have to resort to and if/else block.
Reply With Quote
  #3  
Old 08-25-2009, 02:27 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stanger89 View Post
You mean like this:
Code:
prop1 = GetProperty("prop1", false)
prop2 = SomeRandomPropertyName()
SetProperty(prop2, not(prop1))
I think that should work... Though I don't remember if you can use the bang (!) to negate, or if there's a "not" keyword, or if you're going to have to resort to and if/else block.
I am not trying to set the property thought it is just an attribute it does work if I am setting a property.
Reply With Quote
  #4  
Old 08-25-2009, 02:33 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
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
Reply With Quote
  #5  
Old 08-25-2009, 03:31 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 06:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.