至
至高之光
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TfrmMain.btnSaveAdClick(Sender: TObject);
type
PShortInt=^ShortInt;
var
RomFile: TFileStream;
begin
try
RomFile:=TFileStream.Create(frmOpenDialog.FileName, fmOpenReadWrite);
RomFile.Seek(170872, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeHPAd.Text)))^, 1);
RomFile.Seek(170894, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbePowAd.Text)))^, 1);
RomFile.Seek(170918, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeSklAd.Text)))^, 1);
RomFile.Seek(170942, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeSpdAd.Text)))^, 1);
RomFile.Seek(170966, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeLckAd.Text)))^, 1);
RomFile.Seek(170990, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeDefAd.Text)))^, 1);
RomFile.Seek(171014, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeResAd.Text)))^, 1);
RomFile.Free
except
on EWriteError do
ShowMessage('EWriteError');
end;
end;
程序根本不能在上面指定的各个位置中写规定的信息。(所有的文本框Text都是'0'。)请问一下,这是怎么回事?
type
PShortInt=^ShortInt;
var
RomFile: TFileStream;
begin
try
RomFile:=TFileStream.Create(frmOpenDialog.FileName, fmOpenReadWrite);
RomFile.Seek(170872, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeHPAd.Text)))^, 1);
RomFile.Seek(170894, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbePowAd.Text)))^, 1);
RomFile.Seek(170918, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeSklAd.Text)))^, 1);
RomFile.Seek(170942, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeSpdAd.Text)))^, 1);
RomFile.Seek(170966, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeLckAd.Text)))^, 1);
RomFile.Seek(170990, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeDefAd.Text)))^, 1);
RomFile.Seek(171014, soFromBeginning);
RomFile.WriteBuffer(PShortInt(ShortInt(StrToInt(lbeResAd.Text)))^, 1);
RomFile.Free
except
on EWriteError do
ShowMessage('EWriteError');
end;
end;
程序根本不能在上面指定的各个位置中写规定的信息。(所有的文本框Text都是'0'。)请问一下,这是怎么回事?