Hi - is this possible?
I am creating object names dynamically with the use of arraytostring, which normal works fine, but in this case - I want to be able to change global variables, but not sure how to go about it.
the variable is
LOOP1.lp
of course this works:
LOOP1.lp=1;
but i can't use that structure since i am repeating the function with this attempt assuming the expression name is the name of the global variable - in this case 'lp'
ll has been defined elsewhere (numerical version of LOOP)
decl i,ar,size=9;
for(i=0;i<size;i++){
ar=arraytostring({ll,i+49});
setattribute(findobject(ar),'lp',i+1);
}
any ideas?
thanks!
setexpression of a variable?
Re: setexpression of a variable?
lil bump here - is it possible to use setexpression or some other method to affect global variables?
thanks!
thanks!
Re: setexpression of a variable?
Hi Shane
Sometimes it hard to see a tree for the forest . . .
Try setexpression because it is an expression not an attribute that you are changing
And then it should work, I think . . .
Cheers
MM
Sometimes it hard to see a tree for the forest . . .
Try setexpression because it is an expression not an attribute that you are changing
And then it should work, I think . . .
Cheers
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]
Re: setexpression of a variable?
hi - thanks.
question though - if it is a created expression - what would the 'name' be?
normally you could say:
setexpression(Fader,'x',1);
but in this case - i don't know what the 'x' value would be.
I made a global expression:
Test=0
If i write into a script
Test=1;
that changes it, but how could i address the same expression with setexpression?
thanks!
shane
question though - if it is a created expression - what would the 'name' be?
normally you could say:
setexpression(Fader,'x',1);
but in this case - i don't know what the 'x' value would be.
I made a global expression:
Test=0
If i write into a script
Test=1;
that changes it, but how could i address the same expression with setexpression?
thanks!
shane
-
- Liine Staff
- Posts: 285
- Joined: 01 Oct 2010 11:06
Re: setexpression of a variable?
Hi guys,
It's not possible to use setexpression() for a global variable. A potential solution for your case would be to use a single variable as an array, instead of lots of vars with numbers in their names and calls to arraytostring.
Best,
Nicolas
It's not possible to use setexpression() for a global variable. A potential solution for your case would be to use a single variable as an array, instead of lots of vars with numbers in their names and calls to arraytostring.
Best,
Nicolas
Re: setexpression of a variable?
Or you could just add a pad or something, take it out of the screen (positioned in negative x or y), name it "global", create the expression 'test' in that pad and then use setexpression(global, 'test' value), couldnt you?