我是delphi的初学者,我遇到了终结错误e2155.我正在使用RAD 10并尝试在移动设备上运行我的程序.它在我的Windows机器上工作正常,但是当我改为Android或IOS时,它给了我终结错误.
代码:
type
TRaumparameter = record
ID : string;
Länge: string;
Breite: string;
Höhe: string;
Fläche: string;
Raumvolumen: string;
Wände: string;
Decke: string;
Boden: string;
Baujahr: string;
Heizlast: string;
end;
var Aufstellraum: Traumparameter;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
{$R *.iPad.fmx IOS}
procedure TForm1.speichernClick(Sender: TObject);
var F: File of Traumparameter;
begin
Aufstellraum.Länge:=form2.Länge.Text;
Aufstellraum.Breite:=form2.Breite.Text;
Aufstellraum.Höhe:=form2.Höhe.Text;
Aufstellraum.Fläche:=form2.Fläche.Text;
Aufstellraum.Raumvolumen:=form2.ErgebnisRaumVol.Text;
Aufstellraum.Wände:=form2.Wände.Text;
Aufstellraum.Decke:=form2.Decke.Text;
Aufstellraum.Baujahr:=form2.Baujahr.Selected.Text;
Aufstellraum.Heizlast:=form2.Heizlast.Text;
try
AssignFile(F,'D:\test\1.txt');
ReWrite(F);
Write(F,Aufstellraum);
finally
CloseFile(F);
end;
end;
Run Code Online (Sandbox Code Playgroud)
我已经尝试用[]来限制字符串的长度,但它告诉我:';' 预期,但'''发现.希望我能得到一些答案,因为我安静了一段时间没有任何成功.提前致谢!!
我想从一个ImageList到一个TImage(移动应用程序,fmx)加载图片。TImage 是我的自定义样式列表框 ( LBItem.StylesData['myimage']) 的一部分。标准方法是ImageList.GetBitmap(). 但是 GetBitmap 方法给了我一个错误:“ TimageList does not contain a member named GetBitmap”。任何解释或替代方案?提前致谢!
procedure TForm3.Button1Click(Sender: TObject);
var
i : Integer;
LBItem : TListBoxItem;
Bitmap : TBitMap;
begin
ListBox1.BeginUpdate;
ListBox1.Items.Clear;
Bitmap := TBitMap.Create;
try
for i := 0 to 3 do begin
LBItem := TListBoxItem.Create(nil);
LBItem.Parent := ListBox1;
LBItem.StyleLookup := 'mystyle';
LBItem.StylesData['mylabel'] := 'Some text...';
//Bitmap.LoadFromFile('D:\Koala.jpg');
ImageList1.GetBitmap(i, Bitmap);
LBItem.StylesData['myimage']:= Bitmap;
end;
finally
ListBox1.EndUpdate;
end;
end;
Run Code Online (Sandbox Code Playgroud) delphi ×1
finalization ×1
firemonkey ×1
image ×1
imagelist ×1
listbox ×1
migration ×1
record ×1