1 Reply Latest reply on Dec 5, 2018 5:43 AM by Andrew Waters

    Generic search expressions

    Rémi Chaffard
      Share This:



      I would like inside pattern to run a search with almost everything set as parameter. Is it possible to do such kind of thing:


      results := search(%objKind% where %objKeyAttr% = %obj.key%);


      If not, can you please give me what can be used as parameter and what cannot ?


      Thanks a lot


        • 1. Re: Generic search expressions
          Andrew Waters

          TPL only expects variable usage for values. In this case obj.key.


          It will not compile if you try to put a variable in as the node kind. While it will compile if you put a variable name for the attribute it will not do what you want because you end up with the string, i.e. including quotes), rather than the name and hence be the string constant rather than the value of the attribute. You could use get but that is significantly less performant.

          2 of 2 people found this helpful