How to iterate through a text list in Domino version 5?

Hi,Is there any way to iterate through a text list in Domino version 5.@For,@While,@DoWhile are available

from Domino 6. So I was windering how can I achieve this in version 5.

This is the code iam trying to use:

textList:=@Explode(@UserNamesList);

@For(n := 1;n <= @Elements(textList); n := n+1;

@If(@Contains(textList[n];“Group”);textList[n];“”));

I want to assign a group name to a readers field.Today there are 15 groups and tomorrow they may come with adding another group to the ACL.So I want to put the starting name of the group as Group.i.e the group names will be GroupA,GroupB etc. If "Group"string is found then I will take the full group name(for ex GroupA) and assign it to readers field.

Not sure whether I can achieve this or not? I can’t change my domino directory names.nsf so that I can add a hidden view to find out this group!!!Otherwise I could have achived this easily!!

Thanks in Advance

Viswa.

Subject: How to iterate through a text list in Domino version 5?

You can do exactly what you’re describing here with LotusScript and the NotesACL and NotesACLEntry classes. In fact, it looks like you can do it without forcing your group names to contain the string “Group” too. The NotesACLEntry class has a property called “IsGorup” that indicates whether an ACL entry is a group or not. LotusScript would also give you the kind of looping control you’re looking for. I don’t know of anyway to do the looping you want to do in @Formula in R5, but perhaps there are @Formula experts out there who can correct me.If you’ve never worked with LotusScript before, maybe this is a good time to start. In the end, you’ll have much more control over what you’re trying to do and the code will be more maintainable. Keil.

Subject: RE: How to iterate through a text list in Domino version 5?

Hi KeilThanks for the response. Yeah I know Lotus Script!Just wondering if anybody has a sinple solution with Formula.May be i should go with Lotus Script!!!.

…viswa

Subject: How to iterate through a text list in Domino version 5?

You may be interested in this posting too:

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/124597139ded7bf8852573850073a844?OpenDocument

You don’t need to know the names of groups in advance, nor name them in any special way.

Subject: How to iterate through a text list in Domino version 5?

You know, we got along just fine WITHOUT loops in Formula Language for quite a while. If you’re used to thinking in languages that require loops, it will look like you need a loop. You really aren’t thinking in Formula Language unless you are thinking in LISTS.

What you’ve described can be done in R5 Formula Language with a formula like this:

namesList := @UseNamesList;

backList := @Trim(@Right(namesList; "Group);

@If(backList = “”; “”; “Group” + backlist)

Let’s take a look at how that works. Say @UserNamesList returns something like this:

“CN=Stan Rogers/OU=Dev/O=Essellar”

“Stan Rogers”

“*”

“*/Essellar”

“*/Dev/Essellar”

“GroupDevelopers”

“GroupAdmins”

“[Admin]”

Two of those values contain the string “Group”. When you do the @Right, you will wind up with the values to the right of “Group” in each entry:

“”

“”

“”

“”

“”

“Developers”

“Admins”

“”

@Trim leaves:

“Developers”

“Admins”

Then the last line makes that list into:

“GroupDevelopers”

“GroupAdmins”

Subject: RE: How to iterate through a text list in Domino version 5?

Stan, it’s a sickness for you to be able to think that way ;). I write so much LS I’ve really lost the ability to write complex @Formula code (though your example isn’t all that complex). Thanks for showing us how to do that. Thanks for the great explanation of how it works too.

Subject: RE: How to iterate through a text list in Domino version 5?

Stan,Thank yoy very much for your response. This solved my problem.

Thank you very much once again!!

Viswa