Forums > MaxMSP

Append $1 to Textedit space removal


Sev
November 9, 2012 | 8:25 am

Maybe there are more effective ways to perform this but my target is to get this textedit to only display a single string of symbols that would look like this 1Cbbccbb21 where as the output is this: "1" C b b c c b b "2" "1" (the double quotes around what would be numbers, they are symbols now).

The attached image shows from RIGHT to left, an outside object calling the 9th data point in array1 (which is 4) then the 4th item is being asked of array0 which the output of array0 would be the "symbol 1" or the route of that is "1". Then the append function is compiling each symbol together into a new textedit object (bottom left).

Upstream I have an random object which is helping to decide what happens to array1 thus each value is an int. On the other hand array0 had integers and symbols as the input so when I packed coll array0, everything was converted into symbols (because of the use of a pack and it seemed like a good idea to only give it two arguments (integers and symbols), these integers allowed for a numeric ordering of the symbols (whether these symbols where letters or numbers).

I do not think I can manipulate my data types upstream so easily. Maybe have array0 be 3 values wide and use of the empty set, so at the end of the program: there could be an object that looks for the first filled value. Then returning that value regardless if it is an int or a symbol. I would prefer not to go this route and thus looking for an easier solution.

Are there anyways to strip the double quotes from symbols such as "1"? Are there any easy ways to remove the spaces in between the symbols to form a single string?

Thanks, as you may have figured, I am very new to max.

[attachment=207996,4634]

Attachments:
  1. Untitled1.jpg

November 9, 2012 | 11:11 am

you need sprintf or regexp for that i suppose.



Sev
November 9, 2012 | 11:25 am

Ok, will look into that more. Thanks!


Viewing 3 posts - 1 through 3 (of 3 total)