Evaluate Method in Lotus Script

Hi All,Following is my code:

Dim newDoc As NotesDocument

Dim doc As NotesDocument

Dim uiview As NotesUIView

Dim dc As NotesDocumentCollection

Dim db As NotesDatabase

Dim wks As NotesUIWorkspace







Set db = session.CurrentDatabase

Set dc = db.UnprocessedDocuments

Set newDoc = New NotesDocument(db)

If Not dc.Count = 1 Then

	getMsg("smSelectOneDoc")

	Exit Sub

Else

	Set doc = dc.GetFirstDocument

	Call doc.CopyAllItems (newDoc)

	newDoc.docRelKeyMT(0) = Evaluate("@Unique",newDoc)	

	'newDoc.jpSysKeyMT(0) = Evaluate("@Right(@Unique;6)")

	Call newDoc.Save(True,False)

End If

Everything works ok except the Evaluate method which I want to evaluate the formula (@Right(@Unique;6)).When I say Evaluate of this formula it says Illegal Use of Property.

The document is created fine because it saves it when I commented out the Evaluate statements.

Can anyone please provide some pointers?

Thanks,

Sreeni.

Subject: Evaluate Method in Lotus Script

Hi,

You can’t assign a value to an item using doc.Item(0)

Try this instead:

Dim vTemp As Variant

vTemp = Evaluate(“@Unique”,doc)

doc.docRelKeyMT = vTemp(0)

Subject: RE: Evaluate Method in Lotus Script

Thanks a lot…that worked.

Sreeni.

Subject: Also watch out about using 2 @Uniques, unless you wanted different values in the @Right version.

Subject: Evaluate Method in Lotus Script

Try this

@Right(@Text(@Unique); 6)

I am not sure but I think you have to make it to text first.

Subject: RE: Evaluate Method in Lotus Script

That did not work and it gives me the same error:Illegal USe of Property.

Thanks,

Sreeni.