File: startupoptions.pas

package info (click to toggle)
udm 1.0.0.352-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,076 kB
  • sloc: pascal: 72,496; ansic: 6,892; awk: 880; makefile: 768; sh: 493; perl: 34; python: 22; tcl: 18
file content (99 lines) | stat: -rw-r--r-- 2,073 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
unit startupoptions;

{$mode ObjFPC}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls, SynMemo, appsettings
  ;

type

  { TStartUpOptionsForm }

  TStartUpOptionsForm = class(TForm)
    UDMArgumentsLabeledEdit: TLabeledEdit;
    StartUpSettingsEdit: TLabeledEdit;
    StartupInstructions: TMemo;
    SynMemo1: TSynMemo;
    procedure FormActivate(Sender: TObject);
    procedure StartUpSettingsEditChange(Sender: TObject);
  private

  public

  end;

var
  StartUpOptionsForm: TStartUpOptionsForm;
procedure fillview();

implementation

uses
  Unit1
  , header_utils
  ;

{ TStartUpOptionsForm }

procedure fillview();
var
 File1: TextFile;
 Str: String;
 Filename:String;
begin
  Filename:='commandlineoptions.txt';
  {Display Filename }
  if FileExists(appsettings.DataDirectory+Filename) then
    begin
      AssignFile(File1,appsettings.DataDirectory+Filename);
      {$I-}//Temporarily turn off IO checking
      try
        Reset(File1);
        StartUpOptionsForm.SynMemo1.Clear;
        repeat
          Readln(File1, Str); // Reads a whole line from the file.
          StartUpOptionsForm.SynMemo1.Lines.Add(Str);
        until(EOF(File1)); // EOF(End Of File) keep reading new lines until end.
        CloseFile(File1);
      except
        //StatusMessage('File: changelog.txt IOERROR!', clYellow);
      end;
      {$I+}//Turn IO checking back on.
    end;
  //else
   //StatusMessage('File: changelog.txt does not exist!', clYellow);
   StartUpOptionsForm.Show;

end;

procedure TStartUpOptionsForm.StartUpSettingsEditChange(Sender: TObject);
begin
  StartUpSettings:=StartUpSettingsEdit.Text;
  vConfigurations.WriteString('StartUp','Settings',StartUpSettings);
end;

procedure TStartUpOptionsForm.FormActivate(Sender: TObject);
var
 i:integer;
 s:string='';
begin

  for i := 1 to paramCount() do
      begin
          s:= s + ' ' + paramStr(i);
      end;
  UDMArgumentsLabeledEdit.Text:=s;

  StartUpSettingsEdit.Text:=StartUpSettings;

end;

initialization
  {$I startupoptions.lrs}

end.