Why does this string concatenation work?

in this line i get a compiler error: - "invalid operands char[129] and ‘const char[2]’ t binary [operator+’ "

          m  =  findItemByText(prog.multiName+":"+STRING(prog.multiChannelMIDIChannel) ,idx );

prog.multiname is just a string and prog.multiChannelMIDIChannel is just an int.

how can i get this to compile ? isn’t it possible to do such simple concatenations with JUCE strings ?

What’s STRING()?

just a macro for Juce::String

Of course it is possible with JUCE…
Is your prog.multiname a juce::String…? And your first argument in findItemByText() is a juce::String as well…?

I don’t still understand the STRING macro that you have used… I hope it is simply juce::String(prog.multiChannelMIDIChannel) as it will work nicely for integers…

Try to concatenate into a temp String first and then pass it into your function (just to solve it)… I hope you’ll find out the error…

Yuck! If you’re really too lazy to type it out, you should at least use a typedef, never a macro!

And according to your error message, prog.multiname is a char*, so you should make it a String instead.

Yuck! If you’re really too lazy to type it out, you should at least use a typedef, never a macro!

And according to your error message, prog.multiname is a char*, so you should make it a String instead.[/quote]

yeah youre right abt macros - mea culpa ! will change that eventually…

And yes - turned out multiname is a char[] string in a struct - id’ confused it with another property of the same name which IS a Juce::String and thus missed this.

Thanks