Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
技术板块灌水区
» 如何返回Pchar类型的0
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 如何返回Pchar类型的0
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#1
Post at 2007-7-27 17:40
Profile
|
Blog
|
P.M.
如何返回Pchar类型的0
有一个函数的返回值为Pchar类型,‘0’表示成功,请问如何返回啊
我用StrPcopy(Result,0)的方式工 Result:=0的方式返回均不行
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2007-7-27 23:35
Profile
|
Blog
|
P.M.
Result := '0';
行不?
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#3
Post at 2007-7-28 08:14
Profile
|
Blog
|
P.M.
这个我也试了的,忘写上去了
上面的几项返回方法,在调试时可以看到 Result 的值为nil
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#4
Post at 2007-7-28 13:29
Profile
|
Blog
|
P.M.
知道了,Result := chr($30);
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#5
Post at 2007-7-28 21:56
Profile
|
Blog
|
P.M.
楼上是返回Char了吧?
kendling
(小冬)
高级版主
MyvNet
UID 703
Digest Posts
5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
#6
Post at 2007-7-30 08:54
Profile
|
Site
|
Blog
|
P.M.
|
|
Result := '0'#0;呢?
小冬
http://MyvNet.com
shenloqi
灌水处处长
UID 34
Digest Posts
1
Credits 287
Posts 179
点点分 287
Reading Access 10
Registered 2003-3-15
Status Offline
#7
Post at 2007-7-30 10:13
Profile
|
P.M.
如果需要返回一个可以修改的PChar,你需要用Result := StrNew('0'),然后在使用完返回值之后使用StrDispose释放掉
wfymqj
灌水科科长
UID 1023
Digest Posts 0
Credits 178
Posts 70
点点分 178
Reading Access 10
Registered 2005-9-6
Location 湖北
Status Offline
#8
Post at 2007-7-31 14:09
Profile
|
Blog
|
P.M.
是别人的程序提供的一个接口函数,返回值为Pchar
我在动态链接库 使用 Result := chr($30); 对方的程序就不产生异常,并且结果也正确了
因为是接口函数的返回值,所有应该不需要我来使用StrNew吧
Result := '0'#0还未试,有时间再试试
谢谢各位提供方法
stanleyxu2005
新警察
UID 5617
Digest Posts
1
Credits 45
Posts 15
点点分 45
Reading Access 10
Registered 2007-2-11
Status Offline
#9
Post at 2007-7-31 17:11
Profile
|
Site
|
Blog
|
P.M.
强制把pchar转成int然后再转回pchar试试看
http://getgosurf.com/forum/
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-23 00:49
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008363 second(s), 9 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats