Troubleshooting
String concatenation and arrays
Started by electrofux on .
Sign in or create an account to join the conversation.
Hello,
can i access distinct array items through the setexpression function or do i have to write the whole array in one go?
something like:
setexpression(currentobj,'values',check[0]);
Or anything similar since the above doesnt really work.
can i access distinct array items through the setexpression function or do i have to write the whole array in one go?
something like:
setexpression(currentobj,'values',check[0]);
Or anything similar since the above doesnt really work.
I've only had success creating a temporary array and then using setexpression() to assign it to the object all at once.
check = {0,0,0,1};
setexpression(myBtns, x, check);
At some point in time, I got real tired of trying to figure out clever/cleaner ways and just did it the way I knew worked so I could be done with it. Trying to figure out workarounds every step of the way wore me down.
check = {0,0,0,1};
setexpression(myBtns, x, check);
At some point in time, I got real tired of trying to figure out clever/cleaner ways and just did it the way I knew worked so I could be done with it. Trying to figure out workarounds every step of the way wore me down.
i am trying to do it like that. But it is getting really complicated
Would be much easier if i figured out a way to directly change array items with via concatenation and setexpression.
I am building an single interface to control several sequencers in Reason and at the same time implement a bidirectional cc conversion to make the sequencers react to predefined scales. So to not blow the code up i need every clever trick i can come across
I am building an single interface to control several sequencers in Reason and at the same time implement a bidirectional cc conversion to make the sequencers react to predefined scales. So to not blow the code up i need every clever trick i can come across
I hear you. So, using constructs like currentobj.values = check[0]; or some other type of de-referencing doesn't work? I'm not at a terminal to check it out directly.
If the currentobj is an object referenced by the findobject funtion this indeed doesnt work for me. The code gets red when i put the array brackets behind it.
But i got around it because getexpression(currentobj,'values') works. And then i fiddle around with setexpression and dummy arrays.
But i got around it because getexpression(currentobj,'values') works. And then i fiddle around with setexpression and dummy arrays.
electrofux wrote:If the currentobj is an object referenced by the findobject funtion this indeed doesnt work for me. The code gets red when i put the array brackets behind it.
But i got around it because getexpression(currentobj,'values') works. And then i fiddle around with setexpression and dummy arrays.
That's nice -- I wouldn't have thought to try the on the result of getexpression like that. Good to know it works (well, as of 5.0.3 anyway
I would love to use the same for setexpression. There should be a way to set specific array items with just a setexpression. 