Forums > MaxMSP

comparing strings using if

November 28, 2012 | 12:11 pm

Read the documentation – nothing about strings.

Tried:

if $s1 == this then 0

Doesn’t work. I tried wrapping this in quotes etc, still nothing.

thanks


November 28, 2012 | 4:19 pm

Unfortunately, there is no string data structure per se in Max.

But in your case sel may be an option. Maybe jstrigger is another one.

p


November 28, 2012 | 8:28 pm

The Jash objects has a string compare


November 28, 2012 | 10:35 pm
– Pasted Max Patch, click to expand. –

November 29, 2012 | 12:40 am

@Patrick a jstrigger solution:

– Pasted Max Patch, click to expand. –

November 29, 2012 | 1:49 am

@Emmanuel using your patch we have a problem if we use a list and just the same error if we use the object "sel"

– Pasted Max Patch, click to expand. –

November 29, 2012 | 12:54 pm

maybe this gives you a solution for lists ?

– Pasted Max Patch, click to expand. –

Nikolas


November 29, 2012 | 1:02 pm

zl.compare !

– Pasted Max Patch, click to expand. –

November 30, 2012 | 1:35 am

before [zl compare] existed, you were also already able to use certain zl combinations for this kind of thing.

when looking for a string solutions (we call "strings" "symbols" in max) always look into zl, because
it treats every symbol as a list of symbols with only one element. for example [zl reg] makes a great
place not only to store "1 2 3 4 5", but also for the message "stop".

-110


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