Can an expression acknowledge the Comp's name?
by Bert Brown
on
Nov 13, 2008 at 5:22:58 pm
I have to create many variations of a comp. There is a specific labeling system I have to use and I'm wondering if I can set up a if-then situation to adjust parameters based on what I name the comp.
so for example i have a comp name:
PRIMEHD_P2_L2_TSS
and I want the expression to look for the number after that "L" and adjust a slider number (BAR LENGTH SLIDER) to match that digit. in this case "2"
possible? i ask because i know very little about how to format a label to be read, especially pin-pointing a specific position in that label.
thanks
----------------------------------
peep my over-the-interweb band, red abbott.
"we electro-rock over long distances..."
BTW, just recently learned about the various flavors of parseInt so if you are following along at home, make sure to add the ,10 whenever you use parseInt to make sure you pull base 10 numbers which I imagine is what you'll want 99% of the time..
Re: Can an expression acknowledge the Comp's name? by Darby Edelen on Nov 16, 2008 at 11:53:25 pm
In a case where there is not a need to convert from an arbitrary base to decimal, wouldn't multiplying or dividing by 1 be easier to implement? And also decrease the chances of accidentally misinterpreting the string as octal?
Re: Can an expression acknowledge the Comp's name? by Dan Ebberts on Nov 17, 2008 at 7:14:27 pm
Good point. In a case like this it would make sense to take advantage of JavaScript's implict type conversions. I think I'd use 0 + though. Just like you can convert a number to a string like this: