comparing strings using if

Nov 28, 2012 at 12:11pm

comparing strings using if

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

#65412
Nov 28, 2012 at 4:19pm

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

#235706
Nov 28, 2012 at 8:28pm

The Jash objects has a string compare

#235707
Nov 28, 2012 at 10:35pm
– Pasted Max Patch, click to expand. –
#235708
Nov 29, 2012 at 12:40am

@Patrick a jstrigger solution:

– Pasted Max Patch, click to expand. –
#235709
Nov 29, 2012 at 1:49am

@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. –
#235710
Nov 29, 2012 at 12:54pm

maybe this gives you a solution for lists ?

– Pasted Max Patch, click to expand. –

Nikolas

#235711
Nov 29, 2012 at 1:02pm

zl.compare !

– Pasted Max Patch, click to expand. –
#235712
Nov 30, 2012 at 1:35am

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

#235713

You must be logged in to reply to this topic.