Get Array of lines in textedit using linebreak

Dec 18, 2011 at 1:48am

Get Array of lines in textedit using linebreak

Hi I’m wanting to detect linebreaks in a textedit and based on them, create an array. So far I’ve tried this to no avail:

function text(arg){
arline = arg.split(“/n”)
post(arline.length);
}
but it seems to only get the 1st line. I am wanting to store a list of user editable OSC paths in my patch, maybe there is a better way of doing this?

#60726
Dec 19, 2011 at 5:59pm

OK it was a late night and I was being dumb this is how I got it working:
function text(args){

for(var a = 0; a < arguments.length; a++){
outlet(0,”osc”,arguments[a] );
}
}

#218582

You must be logged in to reply to this topic.