adding string to path

dear touchdesigner community
im having a hard time to understand adding a string to a name.
when im using a value coming from a DAT to add a number to an operators name all is good.
but when i choose to take a value coming from a CHOP it doesn’t work.
has it to do with the fact, that even if it is a integer number, the chop puts out a point and zero to the the value? was that always like that or new to 099? is there a way to avoid that?
maybe someone has an answer for that, would be very glad!
please see the attached .toe file!
thank you very much
best
luca
adding string to path.toe (3.88 KB)

Hi Luca - I think what you want is:

op('constant' + str(int(op('constant1')['chan1'])))

That additional explicit cast to an integer first is important - CHOPs are floats, so your string is something /project1/constant2.0 with your method, when you really want /project1/constant2.

Hope that helps.

1 Like

good morning matthew
aha, i need to put also an integer in the script…!
many thanks for that! every day something new to learn!
have a good day!
best regards luca