1 Star 1 Fork 0

RickyTino/Assistant

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Unit5.pas 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
RickyTino 提交于 2017-01-09 01:12 . Add files via upload
unit Unit5;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, IniFiles;
type
TForm5 = class(TForm)
RichEdit1: TRichEdit;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
Root: string;
DataIni: TIniFile;
implementation
{$R *.dfm}
procedure TForm5.FormClose(Sender: TObject; var Action: TCloseAction);
var
i: longint;
begin
with DataIni do begin
EraseSection('NotePaper');
WriteInteger('NotePaper', 'Width', Width);
WriteInteger('NotePaper', 'Height', Height);
for i := 0 to RichEdit1.Lines.Count - 1 do begin
WriteString('NotePaper', IntToStr(i), RichEdit1.Lines[i]);
end;
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
Root := ExtractFileDir(Application.ExeName);
DataIni := TIniFile.Create(Root + '/Savedata.ini');
Width := DataIni.ReadInteger('NotePaper', 'Width', 400);
Height := DataIni.ReadInteger('NotePaper', 'Height', 400);
Left := 800;
Top := 300;
end;
procedure TForm5.FormShow(Sender: TObject);
var
i: longint;
linestr: string;
begin
i:=0;
RichEdit1.Lines.Clear;
while true do begin
linestr := DataIni.ReadString('NotePaper', IntToStr(i), 'EOF');
if linestr = 'EOF' then break;
RichEdit1.Lines.Add(linestr);
inc(i);
end;
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Pascal
1
https://gitee.com/rickytino/Assistant.git
[email protected]:rickytino/Assistant.git
rickytino
Assistant
Assistant
master

搜索帮助