 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4772 Location: Pensacola, FL, USA
|
Posted: Sun Apr 19, 2009 5:59 am
Setting ID's |
Is there a way for a setting to quickly reference its own ID?
For example, i made a simple push button that i want to display its ID when clicked.
#SAY %id
#SAY %this
#SAY %name
neither of those work.
This functionality could be useful for a number of reasons |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Apr 19, 2009 1:10 pm |
IDs aren't supposed to change, so is there a reason you can't hard-code it? You could do this via Lua, but it's a bit of a catch-22 because you need the ID to look up the button object in the first place.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4772 Location: Pensacola, FL, USA
|
Posted: Sun Apr 19, 2009 6:58 pm |
I'm not trying to change the ID, i have it hard-coded. i was hoping that there was an equivalent for 'this' in zscript.
I was to referance a dbvar with keys matching setting IDs. |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Apr 19, 2009 9:37 pm |
I mean hard-coding the ID into the script. I think having some more information about what you're trying to do would be helpful, but your problem was "I want to make a push-button that displays its own ID" and I was asking why, since the ID of the button shouldn't ever change, you couldn't just write #say whateverYouWroteInTheIDBox in the Script box. That seems to be the easiest way to solve your problem.
So yes, what are you trying to do? Your original post is asking about returning the ID of the setting that's running, which I hope I've made clear is as simple as writing whatever you wrote in the ID box into the script box. Having a list of IDs in a variable and trying to do something (what?) with them is a different problem. |
|
|
 |
|
|