Hello!
I was wondering if it is possible to have this sort of code:
if(nameoftheobject==banana1) do this
if(nameoftheobject==banana2) do that
this is because I have a cluster of the same object and since i change the code quite a bit, I would love the possibility to just copy and paste another element (which will have a sequential number) and get the result done
Hope I made myself clear, let me know.
1000 thanks
Bye for now.
Gio.
Self reference conditional statement
Re: Self reference conditional statement
With this script residing inside an object
The name of the object will be returned.
Code: Select all
getattribute(getobject(), 'name')
Re: Self reference conditional statement
Hi
Another option is a variable in each object with the same code - this can then be easily queried from anywhere . . .
More to the point though is where is the code going to run from, what are you wanting to do, what are the other objects etc etc
Code can be structured in numerous ways to achieve the same thing - with varying performance and for various reasons
Encapsulation of objects into containers as modules can help in easing duplication issues
So sorry but no hard and fast answer here - more info needed . . .
MM
Another option is a variable in each object with the same code - this can then be easily queried from anywhere . . .
More to the point though is where is the code going to run from, what are you wanting to do, what are the other objects etc etc
Code can be structured in numerous ways to achieve the same thing - with varying performance and for various reasons
Encapsulation of objects into containers as modules can help in easing duplication issues
So sorry but no hard and fast answer here - more info needed . . .
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
-
- Newbie
- Posts: 8
- Joined: 25 Jul 2013 01:13
Re: Self reference conditional statement
Thanks man! I'll try it ASAP!Softcore wrote:Code: Select all
getattribute(getobject(), 'name')
Thanks Macciza, that's exactly how I've solved it in this moment.Macciza wrote:Hi
Another option is a variable in each object with the same code - this can then be easily queried from anywhere . . .
MM
Every object in the cluster has an index variable inside the object and I change only that.
It seems to work smoothly, I'll let you know.
You're right about the lackness of information, but I was asking the question while writing the code, while thinking about the logistics of the interface... Everything was "in the cloud" and I couldn't give more info on that, because I didn't know exactly where I was going with the code .
Thanks a lot guys!
See you soon.