Partition, Filter by expression examples are just Integers

   182   1   0
User Avatar
Member
294 posts
Joined:
Offline
Hi
I am trying filter workitems based on a string attribute, looking through the examples, literally all examples
and they are all using integer attributes, is string not working, if they are working, what is the magic?
`@some_string` == "foo"
Cheers
Jens Martensson
FX Supervisor @ Weta Digital
User Avatar
Staff
223 posts
Joined: May 2014
Offline
If you're using HScript, you need to use the strcmp function to compare strings:

https://www.sidefx.com/docs/houdini/expressions/strcmp.html [www.sidefx.com]

Strcmp returns 0 when the strings are the same, so for example strmp(@pdg_output, “example.txt”) == 0. Or, using your example: strcmp(@some_string, “foo”) = 0.
Edited by tpetrick - July 25, 2019 00:15:53
  • Quick Links