storing number for line~

p.dec's icon

what is the best way of storing and changing sets of numbers to be used with line~. the sets of numbers will be of various lengths.

im a bit stuck due to the comma (eg 100, 69 68 47 36) which makes storing the numbers in a text box impossible as it reads the numbers as two separate lines of data.... whats the best object/way of storing them? pattr?

one idea i had was to store the numbers without the comma and then add it before it goes into line~ but i cant work out how to do that either.

Thanks Paul

Chris Muir's icon

On Jun 11, 2008, at 11:09 AM, Paul de Casaparis wrote:

> im a bit stuck due to the comma (eg 100, 69 68 47 36) which makes
> storing the numbers in a text box impossible as it reads the numbers
> as two separate lines of data.... whats the best object/way of
> storing them? pattr?

A single number is really just shorthand for "go to this number
immediately."

You could just send pairs of number with the first being 0 0 (if you
wanted to start from 0)

-C

Chris Muir
cbm@well.com    
http://www.xfade.com

Morten Elkjær's icon

Hi Paul

You can use "coll" to store the lists without the comma and then slice them up with "zl slice" to make the "comma" effect.

look at this little example:

Max Patch
Copy patch and select New From Clipboard in Max.

- Morten

p.dec's icon

zl is a great object... thanks for introducing to to it.

justin's icon

WRT to commas in max u should read the tutorials and topics PDF (name might have changed in max 5). The chapter on punctuation (p.117) is the one you are after:

"As in an object box, the backslash () in a message negates the special characteristics of the character it immediately precedes."

other objects which can come in handy are: sprintf / atoi / itoa

hth,

j