CnPack Forum


 
Subject: 如何声明函数,才可以使用这种形式的调用?
zzzl (早安的空气)
版主
Rank: 7Rank: 7Rank: 7



UID 590
Digest Posts 0
Credits 399
Posts 199
点点分 399
Reading Access 100
Registered 2004-11-29
Status Offline
Post at 2009-9-21 23:44  Profile | Blog | P.M.  | QQ
如何声明函数,才可以使用这种形式的调用?

begin
    fun([["a", "b"], [1, 2]]);
end
Top
freespace8
新警察
Rank: 1



UID 22007
Digest Posts 0
Credits 26
Posts 11
点点分 26
Reading Access 10
Registered 2007-8-2
Status Offline
Post at 2009-9-22 10:51  Profile | Blog | P.M. 
procedure fun(const Args1, Args2: array of const);
begin
end;

try it~
Top
freespace8
新警察
Rank: 1



UID 22007
Digest Posts 0
Credits 26
Posts 11
点点分 26
Reading Access 10
Registered 2007-8-2
Status Offline
Post at 2009-9-22 10:53  Profile | Blog | P.M. 
没仔细看帖。。。。这个就不知道了
Top
bahamut8348
灌水司司长
Rank: 6Rank: 6


UID 4743
Digest Posts 14
Credits 337
Posts 79
点点分 337
Reading Access 10
Registered 2007-1-18
Status Offline
Post at 2009-9-23 15:43  Profile | Blog | P.M. 
type
  t... = array [...] of array [...] of TVarRec
function ...(...: t...)...




做人要厚道,看帖要回贴
Top
zzzl (早安的空气)
版主
Rank: 7Rank: 7Rank: 7



UID 590
Digest Posts 0
Credits 399
Posts 199
点点分 399
Reading Access 100
Registered 2004-11-29
Status Offline
Post at 2009-9-26 09:44  Profile | Blog | P.M.  | QQ
不行
Top
kendling (小冬)
高级版主
Rank: 8Rank: 8
MyvNet


Medal No.1  
UID 703
Digest Posts 5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
Post at 2009-9-28 14:58  Profile | Site | Blog | P.M.  | QQ | Yahoo!
4楼的应该可行。




小冬
http://MyvNet.com
Top
zzzl (早安的空气)
版主
Rank: 7Rank: 7Rank: 7



UID 590
Digest Posts 0
Credits 399
Posts 199
点点分 399
Reading Access 100
Registered 2004-11-29
Status Offline
Post at 2009-9-28 21:46  Profile | Blog | P.M.  | QQ
试过了啊,不行的啊
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-9-29 10:47  Profile | Blog | P.M. 
一定要這樣調嗎?
Top
kendling (小冬)
高级版主
Rank: 8Rank: 8
MyvNet


Medal No.1  
UID 703
Digest Posts 5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
Post at 2009-9-29 17:15  Profile | Site | Blog | P.M.  | QQ | Yahoo!
function ...(array of array of const):...

这样呢/




小冬
http://MyvNet.com
Top
zzzl (早安的空气)
版主
Rank: 7Rank: 7Rank: 7



UID 590
Digest Posts 0
Credits 399
Posts 199
点点分 399
Reading Access 100
Registered 2004-11-29
Status Offline
Post at 2009-9-29 21:31  Profile | Blog | P.M.  | QQ
不行。。

也不是必需要这样,只是觉得[]能在参数里,[[]]也能应可行才对,呵呵
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-9-29 23:26  Profile | Blog | P.M. 
呵呵,我也觉得,不过事实好像是不支持
Top
jjwwang
普通灌水员
Rank: 2



UID 40594
Digest Posts 0
Credits 50
Posts 22
点点分 50
Reading Access 10
Registered 2008-6-22
Status Offline
Post at 2009-11-10 11:50  Profile | Blog | P.M. 
begin
    fun( [  ['a', 'b'], ['1',' 2']  ] );
end

上面这样有办法声明,

下在的这样, 类型都不一样,估计没戏.

begin
    fun([["a", "b"], [1, 2]]);
end但
Top
 




All times are GMT++8, the time now is 2024-12-4 17:06

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.014662 second(s), 8 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP