unitformshujuyuan.pas

来自「这是一个用Delphi开发的读取K线的股票分析系统」· PAS 代码 · 共 64 行

PAS
64
字号
unit UnitFormShuJuYuan;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TFormShuJuYuanSheZhi = class(TForm)
    ButtonBaoCun: TButton;
    ButtonClose: TButton;
    LabelRiXian: TLabel;
    EditRiXianShuJu: TEdit;
    procedure FormShow(Sender: TObject);
    procedure ButtonBaoCunClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormShuJuYuanSheZhi: TFormShuJuYuanSheZhi;

implementation

uses KXianMain;

{$R *.DFM}

procedure TFormShuJuYuanSheZhi.FormShow(Sender: TObject);
Var ShuJuYuanFile:TextFile;
Var TempStr:String;
begin
    If FileExists('ShuJu.Txt') Then
    Begin
       AssignFile(ShuJuYuanFile, 'ShuJu.Txt');
       FileMode := 0;
       Reset(ShuJuYuanFile);
       Readln(ShuJuYuanFile,TempStr);
       EditRiXianShuJu.Text:=TempStr;
       CloseFile(ShuJuYuanFile);
    End;
end;

procedure TFormShuJuYuanSheZhi.ButtonBaoCunClick(Sender: TObject);
Var ShuJuYuanFile:TextFile;
begin
  Try
       AssignFile(ShuJuYuanFile, 'ShuJu.Txt');
       FileMode := 1;
       ReWrite(ShuJuYuanFile);
       Writeln(ShuJuYuanFile,EditRiXianShuJu.Text);
       CloseFile(ShuJuYuanFile);
       KXianMain.DayPathName:=EditRiXianShuJu.Text;
       MessageDlg('数据源设置参数已经成功保存!', mtInformation,[mbOk], 0);
  Except
    MessageDlg('文件读写错误,请重试!', mtInformation,[mbOk], 0);
  End;
End;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?