`

Domino 公式的使用技巧

阅读更多
Domino公式的运行机制:

原来认为LS是编译成为Java在运行是错误的!LS是通过二进制解释器(Bytecode Interpreter)

调用核心API(C/C++)完成执行过程。


Figure 23-1: The Formula language is faster because it is closer to the iron, or more tightly integrated with the Notes/Domino API.

什么时候使用公式:

1、 从视图中取数据

2、 表单中的域值校验和转换

3、 处理字符串数组的时候公式效率其高

4、 在客户端自带的Action中大多都可以通过@Command来触发

@Functions(Arg1; Arg2;... Argn),一般完成两件事情:

1 执行一段程序

2 返回值

关于子文档:

@AllChildren:所有直接子文档

@AllDescendants:所有子文档

关于附件:

@Attachments:返回本文档所包含的附件个数

@AttachmentNames:返回本文档所包含的附件名称(数组)

@AttachmentLengths返回本文档所包含的附件大小(数组)

关于char(n)

Char(13):回车换行

Char(10):回车

Char(9):Tab

关于@DbName:返回执行这段程序所在的服务器和数据库地址

Subset(@DbName; 1): 返回服务器地址

@Subset(@DbName; -1): 返回数据库路径

关于@DeleteField:快速删除文档中的一个域值

FIELD SomeField := @DeleteField

新功能:

@BusinessDays(start date list; end date list; days to exclude; dates to exclude):

Weekend := 1 : 7;

Holidays := @TextToTime("11/28/02" : "11/29/02" : "12/24/02" :

"12/25/02");

Workdays := @BusinessDays(@TextToTime("11/01/02");

@TextToTime("12/31/02"); Weekend; Holidays)

This would return a number of 39, indicating there are 39 working days based on the parameters provided.

@Count(list)

两个完成的功能都是统计一个List里面值的数量

但是当List是空的时候,@Count=1@Elements=0

@Elements(list)

@Sort(list; [order]; custom sort expression):完成各种特定的排序功能

@StatusBar(string):告诉用户程序执行情况

@Text(value; format code):可以实现各种格式之间的转换

CurString := @Text(123.45; "C")(把文字转换成货币)CurString := "$123.45"
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics