Stop Empty Textedits from getting through

Sep 11, 2013 at 3:23pm

Stop Empty Textedits from getting through

Hi I’m routing a text edit to a [route text]. I want to stop empty text messages going down the pipe. I’m finding it very difficult. Anyone got any ideas? Looking at the forum, it seems working with null values is troublesome.

#265041
Sep 11, 2013 at 5:56pm

not sure if this is what you want…

<code>

– Pasted Max Patch, click to expand. –

</code>

#265059
Sep 12, 2013 at 9:34am

Thanks that did the trick!

#265115
Sep 12, 2013 at 12:29pm

Hi,

perhaps a bit late, but The sadam Library contains an object called [sadam.empty], which would detect (or generate) empty strings.

HTH,
Ádám

#265135
Sep 14, 2013 at 7:16am

Thanks Adam for the suggestion I eventually went for a JS solution as i could combine so many objects (route,prepend,change (for symbols?)in a few lines of code. The more I use Max the more I end up just writing a js for what should be simple things. I don’t think max is that good for simple non realtime data processing. Detecting an empty string should be a lot easier than this. It’s just a bit messy having to link up a new js file or the time, would be nice if you could ‘embed’ a js like the way you double click a col object to see some stuff. Anyhow just my 2 cents.
Here’s my script it’s simply to pipe a host into a udpsend object. I can now just have this inbetween my textedit and udpsend object.

var lastHost = “”;
function text(host){
if (typeof host != “undefined” && host !=lastHost){
outlet(0,”host” , host)
}
}

#265277

You must be logged in to reply to this topic.