导航
  • 主页
  • 语言基础/算法/系统设计
  • 数据库相关
  • 图形处理/多媒体
  • 网络通信/分布式开发
  • VCL组件开发及应用
  • Windows SDK/API
  • 问答

bcb向delphi转行,字符串数组如何赋初值??

wangxd 2003-12-10 10:37:36
在bcb中我可以这样赋值:
AnsiString tmpact[28]={"Acknowledge","LookDown",
"Sad","Alert","LookDownBlink","Search","Announce",
"LookUp","Blink","LookUpBlink","Confused",
"LookLeft","Suggest","Congratulate","LookLeftBlink",
"Surprised","Decline","LookRight","Think",
"DontRecognize","LookRightBlink","Wave","Explain",
"Write","Pleased","Read","Greet","RestPose"};
在delphi中我应该怎样做??
我不想这样做,太费劲了
tmpact[0]:="aa";
tmpact[1]:="bb";
tmpact[2]:="cc";
....
...全文
78 点赞 收藏 4
写回复
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyc189 2003-12-10
procedure TForm2.BitBtn1Click(Sender: TObject);
const
tmpact:Array[0..27] of AnsiString=('Acknowledge','LookDown',
'Sad','Alert','LookDownBlink','Search','Announce',
'LookUp','Blink','LookUpBlink','Confused',
'LookLeft','Suggest','Congratulate','LookLeftBlink',
'Surprised','Decline','LookRight','Think',
'DontRecognize','LookRightBlink','Wave','Explain',
'Write','Pleased','Read','Greet','RestPose');
begin

end;
这样也是可以的啊
回复
wangxd 2003-12-10
我试验了,只能把以上代码写在var后,implementation前,不能写在其它地方,为何???
回复
xyc189 2003-12-10
const
tmpact:Array[0..27] of AnsiString=('Acknowledge','LookDown',
'Sad','Alert','LookDownBlink','Search','Announce',
'LookUp','Blink','LookUpBlink','Confused',
'LookLeft','Suggest','Congratulate','LookLeftBlink',
'Surprised','Decline','LookRight','Think',
'DontRecognize','LookRightBlink','Wave','Explain',
'Write','Pleased','Read','Greet','RestPose');
回复
wangxd 2003-12-10
up
回复
发动态
发帖子
Delphi
创建于2007-08-02

4809

社区成员

Delphi 开发及应用
申请成为版主
社区公告
暂无公告