Forums > MaxMSP

how to combine numbers from different sources?

September 29, 2007 | 4:19 pm

So three sources: 1 0 1
become: 101

thanks


September 29, 2007 | 4:25 pm

On 29 sept. 07, at 18:19, chaosmoon wrote:

> So three sources: 1 0 1
> become: 101

sprintf allows you to concatenate anything: [sprintf %i%i%i] will do
the job (%i, %d, %ld means integer).

HTH,
ej


September 29, 2007 | 4:30 pm

pack or pak?

Keith

On 9/29/07, chaosmoon

wrote:
>
> So three sources: 1 0 1
> become: 101
>
> thanks
>


Keith Manlove
(512) 825-9176
keithmanlove@gmail.com


September 29, 2007 | 4:44 pm

yep, sprintf works like a charm. Drops leading zeros, but i can live with that.

thanks.


September 29, 2007 | 5:02 pm

On 29 sept. 07, at 18:44, chaosmoon wrote:

> yep, sprintf works like a charm. Drops leading zeros, but i can
> live with that.

You can add leading zero with [sprintf symout %.2d%.2d%.2d].

ej


September 29, 2007 | 5:20 pm

yeah, sorry… wasn’t paying that much attention. I second the sprintf.

Keith


September 29, 2007 | 5:26 pm

perfect.

thanks for your time.


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