起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 182|回复: 3

【搞定】function的参数设置相关问题**

[复制链接]
发表于 2007-8-13 16:13:04 | 显示全部楼层 |阅读模式
如下面这个函数,
function Txxx.fnReturnXXX(const PDestDs:TDataSet):string;
var lvTempDs:TDataSet;
begin
  ......
  
  lvTempDs.Last;
end;
我要使得lvTempDs的内容与PDestDs一样,但对lvTempDs的任何操作不影响到PDestDs(如 lvTempDs.Last,而PDestDs没有被Last)。
请问我要如何定义这样的函数?
回复

使用道具 举报

发表于 2007-8-13 16:37:14 | 显示全部楼层
function Txxx.fnReturnXXX(PDestDs:TDataSet):string;
回复 支持 反对

使用道具 举报

发表于 2007-8-13 16:38:14 | 显示全部楼层
Shares the data belonging to another client dataset.

procedure CloneCursor(Source :TCustomClientDataSet; Reset: Boolean; KeepSettings: Boolean = False); virtual;


Description

Call CloneCursor to share the data belonging to another client dataset. Source indicates another client dataset whose data is to be shared.

Reset and KeepSettings determine how to set the values of the following properties and events:

Filter, Filtered, FilterOptions, and OnFilterRecord
        IndexName
        MasterSource and MasterFields
        ReadOnly
        RemoteServer and ProviderName

If Reset and KeepSettings are both False, the values of the properties listed above are all set to match the source dataset.

If Reset is True, the properties listed above are all cleared.

If Reset is False and KeepSettings is True, the properties listed above are not changed. In this case, the application must ensure that existing indexes, providers, and so on are compatible with the cloned data.

After calling CloneCursor, the data for the client dataset is the same as the data for Source. Edits performed by either client dataset are reflected in the data of both datasets.

Note:        Because cloned cursors are shared, changing properties that affect the cursor affect both datasets. For example, setting the ReadOnly property of either dataset will make both datasets read-only.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-13 17:47:27 | 显示全部楼层
alang给的CloneCursor正是我想要的,呵呵。
二楼的方法我也是试过了,不可以。我本以为有类似DotNet里头的ByVal和ByRef东西。
谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-6-25 21:48 , Processed in 0.040537 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表