Stop Empty Textedits from getting through

orange_glass's icon

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.

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

not sure if this is what you want...

orange_glass's icon

Thanks that did the trick!

$Adam's icon

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

orange_glass's icon

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)
    }
}