从 Lotus Formula 调用 Lotus Script 函数
我需要从 Lotus Formula 调用 Lotus 脚本函数。
该函数返回一个结果。我不想只是运行一个不返回任何值的脚本。
这是针对 Lotus Notes 7 的。
示例
LotusScript 函数:
Function isName( name As String) as Boolean
if name Is "Danny" Then
isName = true
endif
isName = false
End function
LotusFormula
name := getName("troy")???????
因此我可以在 Lotus 公式中使用该名称。
这可能吗?
I need to call a lotus script function from Lotus Formula.
The function returns a result. I do not just want to run a script which does not return any value.
This is for Lotus Notes 7.
Example
LotusScript Functions:
Function isName( name As String) as Boolean
if name Is "Danny" Then
isName = true
endif
isName = false
End function
LotusFormula
name := getName("troy")???????
therefore I can then use the name in lotus formula.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不。从公式语言中您可以做的最好的事情就是使用 ToolsRunMacro 或 RunAgent @Commands 调用 LotusScript 代理,通过文档字段或环境变量交换值。
No. The best you can do from Formula Language is to call a LotusScript agent using either the ToolsRunMacro or RunAgent @Commands, exchanging values through document fields or environment variables.
无法从公式语言调用并返回 LotusScript 中的值。但是,您可以使用 LotusScript Evaluate 方法采用另一种方式。也许您可以重新设计您的逻辑,使其主要基于 LotusScript。
There is no way to call and return a value in LotusScript from the formula language. However, you can go the other way with the LotusScript Evaluate method. Perhaps you can redesign your logic to be based in LotusScript primarily.
您可以从 LotusScript 中运行公式,但反之则不然,除非您使用 Stan 所回避的代理。
经过几年疲惫的开发后,我通常会考虑为我的大部分工作编写 LotusScript,例外情况是我可以用少于 10 行编写公式,并且不太可能与其他文档交互或更新它们。
一旦您需要查询其他文档中的许多字段或更新它们,请将它们写入脚本中。您在问题中列出的特定函数也可以作为公式使用,但如果您希望在脚本中将其模块化,那么您应该考虑在这些情况下专门使用脚本来代替公式。我想说,公式只是进行基本操作的捷径。
You can run formula from within LotusScript, but not the other way around, unless you use an agent as Stan has eluded to.
After a few weary years of dev, I generally consider writing lotusScript for most of my work, the exceptions are only if I can write the formula in less than 10 lines and it's unlikely to interact with other documents or update them.
As soon as you need to interrogate many fields in other documents or update them, write them in script. The particular function you have listed in your question would also work as formula, but if your desire is to modularise it in script, then you should consider using script, in those situations exclusively, in place of formula. I would say Formula is merely a short cut for doing basic operations.
使用环境变量 - 通过
公式环境变量
设置名称,并使用脚本访问环境变量并执行您的代码。Use Environment variable - Set name through
Formula Environment variable
and use the script to access the environment variable and execute your code.