выполнить формулу

  • Автор темы aks
  • Дата начала
Статус
Закрыто для дальнейших ответов.
A
#1
Здравствуйте, господа! Возможно ли выполнить @-формулу в скрипте? Искал поиском на форуме - ничего не нашёл, хотя помню, что обсуждалось. Подскажите пожалуйста.

Спасибо!
 

morpheus

скриптописец
07.08.2006
3 915
1
#2
Evaluate function and statement

Example
Execute a Lotus software application macro.
Syntax
Evaluate ( macro [ , object ] )
Elements
macro
A string expression specifying the text of a Lotus software application macro, in the syntax that the product recognizes. Refer to the Lotus software documentation for the correct syntax of the macro.
If the macro text is in a constant or string literal, the Lotus software application needs to do only initial processing of the macro once, at compile time, while variable strings incur that processing each time the macro is evaluated.
object
Optional. The name of a product object. Refer to the product documentation to determine if the macro requires an object, and what the object is.
Return value
If the Lotus software application macro being executed returns a value, the Evaluate function returns a Variant containing that value. Otherwise, the function does not return a value.

Код:
' For each document in a Notes database, use a Notes macro to
' compute the average for a list of numeric entries in the 
' NumberList field. Evaluate returns a Variant, and Notes 
' macros return an array. In this case, the array contains only 
' 1 element (element 0). For more info, see the Notes
' documentation.

Sub Click(Source As Button)
' The macro text must be known at compile time.
Const NotesMacro$ = "@Sum(NumberList) / @Elements(NumberList)"
Dim result As Variant, j As Integer
Dim db As New NotesDatabase("", "MYSALES.NSF")
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set dc = db.AllDocuments
For j% = 1 To dc.Count
Set doc = dc.GetNthDocument(j%)
result = Evaluate(NotesMacro$, doc)
MessageBox("Average is " & result(0))
Next
End Sub
 
Статус
Закрыто для дальнейших ответов.