sprintf maximum arguements

May 22, 2008 at 4:00pm

sprintf maximum arguements

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?

#38014
May 22, 2008 at 4:15pm

I think I can use the text object :)

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

#131691
May 22, 2008 at 4:46pm

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

#131692
May 22, 2008 at 7:21pm

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

#131693
May 23, 2008 at 10:06am

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.

#131694
May 23, 2008 at 10:56am

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

#131695
May 23, 2008 at 11:05am

message 1

message 2

combined

#131696
May 23, 2008 at 12:32pm

Ah the symbol thing!

Ta

#131697

You must be logged in to reply to this topic.