编程为何出错?各位大虾帮忙啊!
这是我编的一段:老是提示caption一句unterminated string错误,后来我定义了,可是提示还是unterminated string,为何?
procedure TImageForm.FileListBox1Change(Sender: TObject);
var
FileExt:string[4];
Caption:string;(此处定义)
begin
FileExt:=ExtractFileExt(FileListBox1.FileName);
if(FileExt='.bmp') or (FileExt='.ico') then
begin
Image1.picture.loadFromFile(FileListBox1.FileName);
Caption:=FormCaption+ExtractFileName(FileListBox1.FileName);(此处提示有错误)
if(FileExt='.bmp')then
begin
Caption:=Caption+Format('%d*%d),[Image1.Picture.Width,Image1.Picture.Height);
ViewForm.Image1.Picture:=Image1.Picture;
ViewForm.Caption:=Caption;
end
if(FileExt='.ico')then Icon:=Image1.Picture.Icon;
end
else if(FileExt='.jpg) then
begin
JpgImage.LoadFromFile(FileListBox1.FileName);
Image1.Picture.Graphic:=JpgImage;
Caption:=FormCaption+ExtractFileName(FileListBox1.FileName);
Caption:=Caption+ Format(%d*%d),[Image1.Picture.Width,Image1.Picture.Height);
ViewForm.Image1.Picture.Graphic:=JpgImage;
ViewForm.Image1.Caption:=Caption;
end
end