sprintf maximum arguements

Mike S's icon

Hello All

I need to create a string that has more arguments than 31(which appears to be the largest in my version 4.6.2)

I tried with zl join etc but I have some commas in the string which caused problems with this aproach

any easy way round this?

Mike S's icon

I think I can use the text object :)

The forum could do with a delete thread function if no-one has replied.

Mike S's icon

Maybe not

I found that using the output of sprintf in to text you need 7 x '' in the sprintf object in order to have the comma properly added to the output of text.

like %f\\\, %f

then put in to text

then the output from text would be 1.5, 2.5

mzed's icon

Quote: Mike S wrote on Thu, 22 May 2008 09:00
----------------------------------------------------
> Hello All
>
> I need to create a string that has more arguments than 31(which appears to be the largest in my version 4.6.2)
>
> I tried with zl join etc but I have some commas in the string which caused problems with this aproach
>
> any easy way round this?
----------------------------------------------------

I'd probably look at javascript.

mz

Peter Castine's icon

You may also find a simple solution by daisy-chaining sprintf objects. Use a couple of sprintf's at the top level to concatenate string segments that do not contain commas, then use a final sprintf to insert the commas between the main components.

The flexibility is not unlimited, but may be enough for your purposes.

Mike S's icon

But don't you need to provide the same number of %s or %f anyway?

For example

message 1 = transpose 20

message 2 = pitch 500Hz

message 1

message 2

combined

Peter Castine's icon

message 1

message 2

combined

Mike S's icon

Ah the symbol thing!

Ta