海航聚宝怎么样靠谱么:在DELPHI7.0中用Messagebox()是否可以显示变量
来源:百度文库 编辑:高校问答 时间:2024/10/03 17:57:11
var
Caption: string;
Content: string;
Content1: string;
begin
Caption := '标题';
Content := '内容';
Content1 := '内容1';
MessageBox(Handle, PChar(Content)+PChar(Content1), PChar(Caption), MB_OK);
end;
为什么出错?
Caption: string;
Content: string;
Content1: string;
begin
Caption := '标题';
Content := '内容';
Content1 := '内容1';
MessageBox(Handle, PChar(Content)+PChar(Content1), PChar(Caption), MB_OK);
end;
为什么出错?
可以:
var
Caption: string;
Content: string;
begin
Caption := '标题';
Content := '内容';
MessageBox(Handle, PChar(Content), PChar(Caption), MB_OK);
end;
你的要这样写
MessageBox(Handle, PChar(Content + Content1), PChar(Caption), MB_OK);