Forums > MaxMSP

Splitting A String (not a list) ?!

Apr 04 2013 | 2:15 pm

Hi everyone,

I have some serial data coming in from a mobile phone, in the format ‘079892673648contentofthemessage’

What i need to do is split the list after something like the 13th number, giving me 2 messages that i can then route.

[zl objects] do not seem to work as I’m assuming it doesn’t qualify as a list.

I know this will possibly lead to [sprintf] or [regexpr] but I have tried using them and failed!

Can anyone help?



Apr 04 2013 | 2:27 pm

Hi thanks for the quick response!

The first example did the trick!

Sorry what did you mean by "cannot be represented?"



Apr 04 2013 | 2:49 pm

Ah I get you, I did notice that and wonder why?

Ive learnt something today! :)


Feb 26 2014 | 5:58 pm

Thanks Nicolas, this helped me out as well!!

Feb 27 2014 | 1:22 am

Sigh. Somebody else can explain to Oli about 32-bit integers. There are about 2,147,483,647 threads discussing this.

I just wanted to remind people that "079892673648" can be represented in Max, if you represent it as a symbol. I’ve not looked at Nicolas’ patch, but the task can be done simply enough using [regexp].

Feb 27 2014 | 1:29 am

Sorry to make you sigh peter i do apologies.

If you check this post is now a year old and the kind people on the forum have helped me to find a solution.

I was always taught ‘if you cant say anything nice dont say anything at all’

Food for thought maybe…

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP