[Csnd] Passing arrays to UDO

I’ve written a UDO to concatenate an array of strings into a single string, with a seperator character. But when I pass an empty string, for some reason when you pass a zero length string, it removes one character from the string.

This is the output from the attached program.

SECTION 1:

[0] ‘one’

[1] ‘two’

[2] ‘three’

‘ontwthree’ ‘one, two, three’

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

test5.csd (1.09 KB)

Could be a bug. Would you be able to open a ticket with your example and we’ll look into it.

Prof. Victor Lazzarini
Maynooth University
Ireland

Hope this was the right place…

https://github.com/csound/csound/issues/1500

yes, thanks.

Prof. Victor Lazzarini
Maynooth University
Ireland

the reason is not in the udo and not in the array, but in strcat:

instr 2
  Sout = "one"
  Sout strcat Sout, ""
  puts Sout, 1
endin
schedule(2,0,0)

outputs "on"

  joachim

Thanks, Joachim!