• Курсы Академии Кодебай, стартующие в мае - июне, от команды The Codeby

    1. Цифровая криминалистика и реагирование на инциденты
    2. ОС Linux (DFIR) Старт: 16 мая
    3. Анализ фишинговых атак Старт: 16 мая Устройства для тестирования на проникновение Старт: 16 мая

    Скидки до 10%

    Полный список ближайших курсов ...

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

  • Автор темы aks
  • Дата начала
Статус
Закрыто для дальнейших ответов.
A

aks

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

Спасибо!
 
M

morpheus

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
 
Статус
Закрыто для дальнейших ответов.
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!