Partition, Filter by expression examples are just Integers

   2781   1   0
User Avatar
Member
342 posts
Joined: 3月 2020
オフライン
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
Effects Supervisor @ Rise VFX
User Avatar
スタッフ
624 posts
Joined: 5月 2014
オフライン
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 - 2019年7月25日 00:15:53
  • Quick Links