December 20, 201015 yr I am trying to highlight a record in a portal where the portal record ID (departmentsFL::ID) = an ID in a global field list (VIEWER_vwr::highlight_g). The IDs are alpha-numeric. I used this: PatternCount ( VIEWER_vwr::highlight_g ; departmentsFL::ID ) This is flawed because the ID DEP1 and DEP11 are both true for PatternCount(). How can I scan a list of text and check for unique text and numbers? Thanks.
December 20, 201015 yr If VIEWER_vwr::highlight_g contains a list of values, then I think this is what you are looking for not IsEmpty( FilterValues( VIEWER_vwr::highlight_g ; departmentsFL::ID ) )
December 20, 201015 yr Author As I was searching, I came across this PatternCount ( "¶" & <Value List Items> & "¶" ; "¶" & <Search Value> & "¶" ) This works. Now, when I search for DEP11 in the list I find only DEP11 and not DEP1. Why does this work? With the carriage returns, the PatternCount() returns 1. Without the carriage returns, it returns 2. Can anyone clarify/enlighten? Thanks.
December 20, 201015 yr Author Thanks, comment and dansmith65. I didn't notice your comments until after my follow-up comment. @dansmith65 - yes, that seems to do the trick. Thanks.
December 20, 201015 yr Can anyone clarify/enlighten? Well, "DEP1" is contained in "DEP11". So: PatternCount ( "DEP1¶DEP11" ; "DEP1" ) returns 2, because "DEP1¶DEP11" contains two occurrences of "DEP1".
December 20, 201015 yr Author Well, "DEP1" is contained in "DEP11". So: PatternCount ( "DEP1¶DEP11" ; "DEP1" ) returns 2, because "DEP1¶DEP11" contains two occurrences of "DEP1". Right, but why does adding a carriage returns to the beginning and end of the list as well as the beginning and end of the value change that?
December 20, 201015 yr Adding carriage returns to "DEP1" changes it to "¶DEP1¶". Neither "DEP11" nor "¶DEP11¶" contain the modified pattern. You need to wrap the value list in carriage returns as well - otherwise the first and the last values in the list will not match the searched value.
December 20, 201015 yr Author Adding carriage returns to "DEP1" changes it to "¶DEP1¶". Neither "DEP11" nor "¶DEP11¶" contain the modified pattern. And the lightbulb goes on. Thanks, comment. That makes sense.
Create an account or sign in to comment