If object using text
Brand new at this. My first question is what exactly is the term for letters in Max/Msp? Numbers are integers or abbreviated as "i" but what are letters and what is their abbreviation?
I’m also attempting to have a text input box that outputs the users text into an "if" or "else" system of objects that depending on what the user inputs has different outcomes. For example, say the user types in the sentence "pitch a tent". If anything other than that exact sentence is typed in, I would want the patch to output the text "error". But if that exact sentence is typed in, I would want the patch to output the text "tent pitched"
Hello and welcome!
I use l to represent a list of numbers/words/whatever or s to represent a symbol "something in quotes".
Use tosymbol and fromsymbol to convert between a list and a symbol. I assume that is the correct way to go.
remember that route discards the prefix unless it does match anything, otherwise it sends out the whole string to the rightmost outlet. In this case, you could use the sel object in it’s place. It should do the same thing as route if you are not sending it a list.
Here is a patch that does what you describe:
I checked the option for textedit that tells it to output as one symbol for this patch, otherwise it will output a list of the words (no quote marks). Use inspector to set these things.
----------begin_max5_patcher---------- 465.3ocyU9rTCBCDF+L7TrSFOVcHoXK0adzwC9.nNNQH1FERXfTaUGe2M+SK sVon0A8.IS91.4a+MYWdIL.cqbIqFAm.WBAAuDFDXkLBA90AnB5xzbZscaHA ag716QCbgTrkJqbkbthA1k9P2IEpZ9yLSXL4nHurXdAWjyT1uFdkn98eWk3U cRpmJYNChPCzOv09vkTU5LtX5MUrTkaGjX84.iGYFGgMijnih93M3YVup8+g SZZSAsvdDnSq3zbjIvqgglgA6GUJq3BEnlwJX00zor8mMQ6J4IQIlIbzv1R+ je2zeiz6i7+hygyfE77bXpDRoEkZG+cX.YqL.+k2O18cC7HKWvFvnmR1NdF2 O34.LvqAgTAORy0G+eDYvXGSFNwLkD2FYh6k5FW2jqPkbsYAptuhPcE5uuyh upB6pw9phKxuKiLTgkwUet6RC57SXyCrmJjYrMt3TNWso55PLtMHxMVo677X Ww3wsgSbK3zGImKb+EC2fu1u0pPq9Am0NF80gdsbdU564h+fgUNJiUq3BphK EM1yj01yLdVFSzrOcAOqTpgh2Bv0a8BPWczjN3HRu5n3N3njd0Qi+24HRGbz 3d2Q3c3n38vQ5EuF9Fv2ASFJ -----------end_max5_patcher-----------
yeah, we call it "symbol" when it is not a number.
[if] will not work with symbols or lists, but you can compare two symbols against
ech other for example using the [zl] object, which is able to treat a symbol as
data type "list with one element".
other objects you should look into are the comparison operators ([==]), [regexp]
Awesome, thank you so much for the help!