Thursday, January 10, 2008

OpenView & RestrictToCategory & StartKey

today i found this stupid? bug.
i had a view that has 1 column as category and second as sorted namelist and some other columns... what i wanted was to take one category and then using StartKey shown only what i wanted... but it didn't work :) . i looked at ibm's forum regarding it and found a lot of posts about this bug...
So don't use this RestrictCategory with StartKey, but i read that it also doesn't work with many other parametres.

Enjoy Lotus !

Tuesday, January 08, 2008

compare arrays

I've seen many different functions which compare arrays, so I've decided to write my variant of this function. I suppose my function much simpler.

here is the script o function

Function ArraysAreEqual (vA As Variant, vB As Variant) As Variant

Dim rez As Variant

rez = Evaluate({@implode(@sort(@Explode("} & Join(vA, "~") & {"; "~")); "~") = @implode(@sort(@Explode("} & Join(vB, "~") & {"; "~")); "~")})

If rez(0) = 0 Then ArraysAreEqual = False Else ArraysAreEqual = True

End Function


advantages of my approach:
- more simple, just 1 line;
- faster;
- we can compare any number of arrays

but any advices will be appreciate! especially disadvantages !

Monday, January 07, 2008

perfect article about evaluate

Would you like to write fewer lines of code? Let Domino do some of your work for you? I doubt you answered no, but if you have, what the heck -- read on to see what you'll be missing! We're going to show you how to use the LotusScript Evaluate statement to easily include short and powerful formula language constructs within your LotusScript code. You'll save a lot of headache, and as much as twenty lines of code at a time! A single Evaluate statement can often replace many lines of complicated script, and in some cases, can do what is nearly impossible in native LotusScript... full article about evaluate

now I will twice think what is better to use LS of @.

Wednesday, January 02, 2008

how to take all schedule agents from db

it takes all schedule agents from database. I suppose that somebody will find better solution, but for this moment I don't see the better solutions...

Dim s As New NotesSession
Dim db As NotesDatabase
Dim nc As NotesNoteCollection

Set db = s.CurrentDatabase

Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = True
Call nc.BuildCollection

Dim note As NotesDocument
Dim nid As String
Dim flag As String

nid = nc.GetFirstNoteId
For i = 1 To nc.Count

Set note = db.GetDocumentByID(nid)
flag = note.GetItemValue("$Flags")(0)

If Instr(flag, "S") Then
Print note.GetItemValue("$Title")(0)
End If
nid = nc.GetNextNoteId(nid)
Next

Lotus Blogs

I found 2 sites which store many lotus notes's blogs. I'll look at them more closely later, but in any case I like it and recommend to lotus notes developers to save the links.

One of them is DominoBlogs.com - I suppose the oldest and another one is Planet Lotus.