Checking values against textfield

Hi!
I am very new to lotus notes and was wondering if anyone can help me out with this.
I have a textfield in Notes. (Admin)
There are about 5 email address in the format: USER1/DEVT/SINGAPORE, USER2/DEVT/SINGAPORE etc..

Is there anyway i can do a "split" and compare with another textfield called : CreatedBy?

Of course it has to "loop" through the whole (Admin) textfield.

Please advice.
LVL 4
darenceangAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fgrushevskyCommented:
Do you know if "Admin" field is a list (multivalue) field or a text string?
if it is a list you can use @member(createdby;admin)
if it is a string you can use @contains(admin;createdby)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
qwaleteeCommented:
Usually, you can do a simple FIELD1 = FIELD2, even if FIELD2 has a list of names.  That's because Notes compares fields with multiple values against each other, and if there is one corresponding match, then they're considered a match. Examples:

FIELD1 is OneA : TwoB : ThreeC
FIELD2 is TwoA : OneB : ThreeC

Notes evalues FIELD1 = FIELD2 as (OneA = TwoA) _OR_ (TwoB = OneB) _OR_ (ThreeC = ThreeC)
Even though the first two possibilities don't match, the third one DOES match (ThreeC = THreeC) so they are considered a match.

In your case, it is more like:
FIELD1 is User2
FIELD2 is User1 : User2 : User3

When Notes does the comparison, it notices that they are "unbalanced," because FIELD1 has onlyo ne value (FIELD1 is like CreatedBy), while FIELD2 has three values (like Admin). So, in order to make them "matchable," Notes treats FIELD1 as if the value is repeated. So it is as if the values are:

FIELD1 is User2 : User2 : User2
FIELD2 is User1 : User2 : User3

Thus, the comparison is (User2 = User1) _OR_ (User2 = User2) _OR_ (User2 = User3)
The middle one matches, so it is considered a match. If FIELD1 contained the value User4, then the comparison would be:
(User4 = User1) _OR_ (User4 = User2) _OR_ (User4 = User3)
None of those mtach, so it would return false.

As I said, the simple upshot is that you can probably just say:
Admin = CreatedBy

Or,
@If(
  Admin = CreatedBy;
    "The CreatedBy value matches one of the admin values";
   "The CreatedBy value does NOT match ANY of the Admin values"
)

This is called "list processing," a comparison of multivalued (List valued) fields. More complicated compraisons are possible, without resoprting to "split." Note that lists are comparable to arrays, they are not a single string with a separator value, as you might find, in, say, JavaScript procesing of a field value.

If you are using LotusScript, it is treated as a true array, and you can loop over it (For, While, Do, whatever loop construct you fancy), using array subscripts.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.