| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 9364 人关注过本帖
标题:翻译pb9的帮助文档
只看楼主 加入收藏
liuzg
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-7-11
收藏
得分:0 
再接再厉,很好
2006-10-11 08:33
ヤ順祺冄繎ヤ
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:3032
专家分:0
注 册:2005-11-9
收藏
得分:0 
我英文差!!

不过transaction object 好像被叫做事务对像
2006-10-11 17:40
第三只眼睛
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-4-7
收藏
得分:0 
"不过transaction object 好像被叫做事务对像"

谢谢,已经改过来了啊.
2006-10-11 18:29
第三只眼睛
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-4-7
收藏
得分:0 

SetFilter

Description
Specifies filter criteria for a DataWindow control or DataStore.

Syntax
PowerBuilder
integer dwcontrol.SetFilter ( string format )

Return value
Returns 1 if it succeeds and -1 if an error occurs. The return value is usually not used.

Usage
A DataWindow object can have filter criteria specified as part of its definition. After data is retrieved, rows that don't meet the criteria are immediately transferred from the primary buffer to the filter buffer.
The SetFilter method replaces the existing filter criteria梚f any are defined for the DataWindow object梬ith a new set of criteria. Call the Filter method to apply the filter criteria and transfer rows that do not meet the filter criteria to the filter buffer.
The filter expression consists of columns, relational operators, and values against which column values are compared. Boolean expressions can be connected with logical operators AND and OR. You can also use NOT, the negation operator. Use parentheses to control the order of evaluation.
Sample expressions are:
item_id > 5
NOT item_id = 5
(NOT item_id = 5) AND customer > "Mabson"
item_id > 5 AND customer = "Smith"
#1 > 5 AND #2 = "Smith"
The filter expression is a string and does not contain variables. However, you can build the string in your script using the values of script variables. Within the filter string, string constants must be enclosed in quotation marks (see the examples).
Removing a filter To remove a filter, call SetFilter with the empty string ("") for format and then call Filter. The rows in the filter buffer will be restored to the primary buffer and positioned after the rows that already exist in the primary buffer.
example:
This statement defines the filter expression for dw_Employee as the value of format1:
dw_Employee.SetFilter(format1)
The following statements define a filter expression and set it as the filter for dw_Employee. With this filter, only those rows in which the cust_qty column exceeds 100 and the cust_code column exceeds 30 are displayed. The final statement calls Filter to apply the filter:
string DWfilter2
DWfilter2 = "cust_qty > 100 and cust_code >30"
dw_Employee.SetFilter(DWfilter2)
dw_Employee.Filter( )
The following statements define a filter so that emp_state of dw_Employee displays only if it is equal to the value of var1 (in this case ME for Maine). The filter expression passed to SetFilter is emp_state = ME:
string Var1
Var1 = "ME"
dw_Employee.SetFilter("emp_state = '"+ var1 +" '")

2006-10-11 18:30
第三只眼睛
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-4-7
收藏
得分:0 

setfilter
描述
为数据窗口控件提供过滤标准。
语法
integer dwcontrol.SetFilter ( string format )
返回值
成功返回1,失败返回-1。该值通常不用。
用法:
一个数据窗口控件通常把明确的过滤标准作为它定义的一部分。数据检索后,不符合标准的数据立即从主要缓冲区送到过滤缓冲区。
setfilter方法取代已经存在的过滤标准—只要它们被拥有新标准的数据窗口对象定义。通过调用filter方法应用过滤标准并把不符合标准的数据送到过滤缓冲区。
过滤表达式由列,关系操作符,被比较的列值的相反值组成。布尔表达式被逻辑操作符AND和OR连接。
典型的例子:
item_id > 5
NOT item_id = 5
(NOT item_id = 5) AND customer > "Mabson"
item_id > 5 AND customer = "Smith"
#1 > 5 AND #2 = "Smith"
过滤表达式是一个字符串并且不能包含变量。尽管如此,你可以使用脚本中的变量值来建立字符串。在过滤字符串中,字符串常量必须用引号括起来。
删除过滤:要移除过滤,调用setfilter通过使用空字符串(“”)然后调用filter。在过滤缓冲区中的数据行将被重新存储在主缓冲区中并存放在主缓冲区中已有的数据后面。

例:
这个例子将为dw_Employee定义一个值为format1的过滤表达式:
dw_Employee.SetFilter(format1)
这个例子定义一个表达式并且把它作为dw_Employee的过滤条件。通过使用该条件,在cust_qty列值超过100并且cust_code列值超过30的数据行被显示。接下来调用filter来应用该过滤条件。
string DWfilter2
DWfilter2 = "cust_qty > 100 and cust_code >30"
dw_Employee.SetFilter(DWfilter2)
dw_Employee.Filter( )
这个例子首先定义一个过滤条件,只有当dw_Employee的emp_state等于var1的时候数据被显示。该例子的setfilter的emp_state值为ME:
string Var1
Var1 = "ME"
dw_Employee.SetFilter("emp_state = '"+ var1 +" '")

2006-10-11 18:31
第三只眼睛
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-4-7
收藏
得分:0 

Filter method (DataWindows)
Description
Displays rows in a DataWindow that pass the current filter criteria. Rows that do not meet the filter criteria are moved to the filter buffer.
Syntax
PowerBuilder
integer dwcontrol.Filter ( )

Usage
Filter causes all rows to be retrieved and then it applies the filter. Even when the Retrieve As Needed option is set, the Filter method retrieves all rows before applying the filter.
Filter uses the current filter criteria for the DataWindow. To change the filter criteria, use the SetFilter method. The SetFilter method is equivalent to using the Filter command on the Rows menu of the DataWindow painter. If you do not call SetFilter to assign or change criteria before calling the Filter method, the DataWindow will default to use the criteria in the object definition.
When the Retrieve method retrieves data for the DataWindow, PowerBuilder applies the filter that was defined for the DataWindow object, if any. You only need to call Filter after you change the filter criteria with SetFilter or if the data has changed because of processing or user input.


描述
在数据窗口中显示符合当前数据过滤标准的数据行。不符合标准的数据行被送到过滤缓冲区。
语法
integer dwcontrol.Filter ( )
用法
filter首先使所有的数据行等待被检索,然后申请过滤条件。只有当设定了检索条件后,filter方法才会检索数据,然后应用过滤条件。
filter使用当前数据窗口的过滤标准。如果想改变过滤标准,需使用setfilter方法。该方法在数据窗口画板的rows菜单中,其使用方法与filter类似。如果你在调用filter方法前没有调用setfilter方法来重新指定或者更改标准,数据窗口将使用在对象中定义的缺省的标准。
当retrieve方法检索数据窗口的数据时,pb应用定义好的filter方法。当由于程序的要求需要改变数据或者需要用户输入数据的时候,你仅仅在setfilter方法中改变过滤条件后调用filter方法就可以了。

2006-10-11 18:31
kevin2123
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-10-23
收藏
得分:0 

厉害啊,等你把他翻译完了,帮助大家学习啊

2006-10-23 21:23
create_xc
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-5-30
收藏
得分:0 
2007-05-30 15:32
yuexiayiyu
Rank: 1
等 级:新手上路
帖 子:152
专家分:0
注 册:2007-1-21
收藏
得分:0 

回头→守望过去岁月 →在我们身上刻下了无法抹去的痕迹→在午夜里→ 静静听见→有人说→过去了→过去了
2007-05-30 15:39
路過
Rank: 3Rank: 3
等 级:论坛游侠
威 望:7
帖 子:160
专家分:111
注 册:2006-12-15
收藏
得分:0 

好,如果有中英接差起來就比較好看一點啦
不用拉一段很大的英,又看中文。不知道對哪裡去。
呵呵中,


2007-05-30 16:00
快速回复:翻译pb9的帮助文档
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016025 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved