Jump to content
Server Maintenance This Week. ×

Highlighting An Alpha-Numeric Record From A List


This topic is 4882 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Well, "DEP1" is contained in "DEP11". So:

PatternCount ( "DEP1¶DEP11" ; "DEP1" ) 

returns 2, because "DEP1DEP11" 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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 4882 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.