New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String get truncated by one character #1500
Comments
ok, maybe not related to UDOs. Could you try making a version without the UDO, putting the code in the instrument and only using an empty string as a separator? I suspect strcat, because if the problem was with passing the string array to an UDO, then you would see a problem with other terminators. |
outputs "on" Joachim Heintz put this together... |
Does the k-rate version work - strcatk?
…On Thu 8 Jul 2021, 9:27 p.m. mjmogo, ***@***.***> wrote:
instr 2
Sout = "one"
Sout strcat Sout, ""
puts Sout, 1
endin
schedule(2,0,0)
outputs "on"
Joachim Heintz put this together...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1500 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUQWGM6VAOC6BYDOGTQ33LTWYCZPANCNFSM5ABLJS6Q>
.
|
ok bug in strcat. thx. |
It appears to only be 'strcat'...
…On Thu, Jul 8, 2021 at 4:54 PM vlazzarini ***@***.***> wrote:
ok bug in strcat. thx.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1500 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUY4O43GBJUSFBAWPFFBE4LTWYNCFANCNFSM5ABLJS6Q>
.
|
Only happens if the destination string is t he same as a source instr 3 |
I think I fixed it. in github now |
I've written a UDO to concatenate an array of strings into one string. It also allows for a separator string that is inserted between the strings. If you pass a string with a length of 0 for the separator, rather than doing nothing, it removes one character from the input string. I'm able to get around this by checking for the length of the separator string before concatenating the strings.
This is the output from the test program.
SECTION 1:
[0] 'one'
[1] 'two'
[2] 'three'
'ontwthree' 'one, two, three'
Score finished in csoundPerform().
The text was updated successfully, but these errors were encountered: