钛的价格多少钱一斤:在DELPHI7.0中用Messagebox()是否可以显示变量

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 07:30:44
var
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);