summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--terminer.lpi5
-rw-r--r--terminer.lps105
-rw-r--r--unit1.lfm2
-rw-r--r--unit1.pas64
4 files changed, 148 insertions, 28 deletions
diff --git a/terminer.lpi b/terminer.lpi
index 3b5ced3..1edb792 100644
--- a/terminer.lpi
+++ b/terminer.lpi
@@ -62,7 +62,7 @@
</Linking>
</CompilerOptions>
<Debugging>
- <Exceptions Count="3">
+ <Exceptions Count="4">
<Item1>
<Name Value="EAbort"/>
</Item1>
@@ -72,6 +72,9 @@
<Item3>
<Name Value="EFOpenError"/>
</Item3>
+ <Item4>
+ <Name Value="EConvertError"/>
+ </Item4>
</Exceptions>
</Debugging>
</CONFIG>
diff --git a/terminer.lps b/terminer.lps
index e8daf48..81955c7 100644
--- a/terminer.lps
+++ b/terminer.lps
@@ -20,72 +20,141 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
- <TopLine Value="111"/>
- <CursorPos X="22" Y="145"/>
+ <TopLine Value="184"/>
+ <CursorPos X="9" Y="221"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../units/mystringlistunit.pas"/>
- <EditorIndex Value="-1"/>
- <TopLine Value="8"/>
- <CursorPos X="15" Y="28"/>
+ <EditorIndex Value="1"/>
+ <TopLine Value="315"/>
+ <CursorPos X="37" Y="333"/>
<UsageCount Value="10"/>
+ <Loaded Value="True"/>
</Unit2>
</Units>
- <JumpHistory Count="13" HistoryIndex="12">
+ <JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="unit1.pas"/>
+ <Caret Line="30" Column="15" TopLine="16"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
- <Caret Line="26" TopLine="8"/>
+ <Caret Line="28" TopLine="15"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
- <Caret Line="30" Column="15" TopLine="16"/>
+ <Caret Line="26" Column="30" TopLine="7"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
- <Caret Line="28" TopLine="15"/>
+ <Caret Line="57" Column="28" TopLine="41"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
- <Caret Line="26" Column="30" TopLine="7"/>
+ <Caret Line="126" Column="3" TopLine="91"/>
</Position5>
<Position6>
<Filename Value="unit1.pas"/>
- <Caret Line="57" Column="28" TopLine="41"/>
+ <Caret Line="95" Column="29" TopLine="55"/>
</Position6>
<Position7>
<Filename Value="unit1.pas"/>
- <Caret Line="126" Column="3" TopLine="91"/>
+ <Caret Line="102" Column="29" TopLine="82"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
- <Caret Line="95" Column="29" TopLine="55"/>
+ <Caret Line="42" Column="3" TopLine="18"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
- <Caret Line="102" Column="29" TopLine="82"/>
+ <Caret Line="112" Column="43" TopLine="93"/>
</Position9>
<Position10>
<Filename Value="unit1.pas"/>
- <Caret Line="42" Column="3" TopLine="18"/>
+ <Caret Line="9" Column="19"/>
</Position10>
<Position11>
<Filename Value="unit1.pas"/>
- <Caret Line="112" Column="43" TopLine="93"/>
+ <Caret Line="144" TopLine="111"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
- <Caret Line="9" Column="19"/>
+ <Caret Line="145" Column="22" TopLine="111"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
- <Caret Line="144" TopLine="111"/>
+ <Caret Line="136" Column="6" TopLine="113"/>
</Position13>
+ <Position14>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="176" Column="11" TopLine="136"/>
+ </Position14>
+ <Position15>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="177" Column="29" TopLine="144"/>
+ </Position15>
+ <Position16>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="161" Column="8" TopLine="147"/>
+ </Position16>
+ <Position17>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="184" Column="18" TopLine="153"/>
+ </Position17>
+ <Position18>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="46" Column="21" TopLine="20"/>
+ </Position18>
+ <Position19>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="187" Column="19" TopLine="152"/>
+ </Position19>
+ <Position20>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="33" Column="22" TopLine="14"/>
+ </Position20>
+ <Position21>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="183" Column="31" TopLine="150"/>
+ </Position21>
+ <Position22>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="304" Column="32" TopLine="289"/>
+ </Position22>
+ <Position23>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ </Position23>
+ <Position24>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="34" Column="22"/>
+ </Position24>
+ <Position25>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="184" Column="31" TopLine="151"/>
+ </Position25>
+ <Position26>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="353" TopLine="321"/>
+ </Position26>
+ <Position27>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="34" Column="22"/>
+ </Position27>
+ <Position28>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="184" Column="31" TopLine="151"/>
+ </Position28>
+ <Position29>
+ <Filename Value="../units/mystringlistunit.pas"/>
+ <Caret Line="333" Column="37" TopLine="315"/>
+ </Position29>
+ <Position30>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="186" Column="8" TopLine="155"/>
+ </Position30>
</JumpHistory>
</ProjectSession>
</CONFIG>
diff --git a/unit1.lfm b/unit1.lfm
index bb60d3d..f0867c0 100644
--- a/unit1.lfm
+++ b/unit1.lfm
@@ -3,7 +3,7 @@ object Form1: TForm1
Height = 543
Top = 283
Width = 728
- Caption = 'Form1'
+ Caption = 'terminer'
ClientHeight = 543
ClientWidth = 728
OnActivate = FormActivate
diff --git a/unit1.pas b/unit1.pas
index 962682c..c8682e6 100644
--- a/unit1.pas
+++ b/unit1.pas
@@ -43,7 +43,7 @@ implementation
{$R *.lfm}
uses
- math;
+ math, lowlevelunit;
{ TForm1 }
@@ -122,6 +122,7 @@ begin
if not inhaltOk then
exit;
image1.canvas.brush.color:=$ffffff;
+ image1.canvas.pen.color:=$000000;
image1.canvas.rectangle(-1,-1,image1.width+1,image1.height+1);
ma:=-1;
mi:=-1;
@@ -161,27 +162,74 @@ end;
procedure tForm1.interpretiereInhalt;
var
- i,j,k: longint;
+ i,j,k,knTag: longint;
+ s,knZeit,t: string;
begin
inhaltOk:=false;
+ image1.canvas.pen.color:=$0000ff;
+ image1.canvas.pen.width:=5;
+ image1.canvas.moveTo(0,0);
+ image1.canvas.lineTo(image1.width,image1.height);
+ image1.canvas.moveTo(image1.width,0);
+ image1.canvas.lineTo(0,image1.height);
+ image1.canvas.pen.color:=$000000;
+ image1.canvas.pen.width:=1;
clearArrays;
setLength(zeiten,spinEdit2.value - spinEdit1.value);
for i:=spinEdit1.value to spinEdit2.value-1 do
zeiten[i-spinEdit1.value]:=i;
tage.text:=memo1.lines.text;
tage.grep('^$',true);
- personen.add('EE');
setLength(kannNicht,length(zeiten));
for i:=0 to length(kannNicht)-1 do begin
setLength(kannNicht[i],tage.count);
- for j:=0 to length(kannNicht[i])-1 do begin
- setLength(kannNicht[i,j],round(5*random));
- for k:=0 to length(kannNicht[i,j])-1 do
- kannNicht[i,j,k]:=0;
+ for j:=0 to length(kannNicht[i])-1 do
+ setLength(kannNicht[i,j],0);
+ end;
+ for i:=0 to memo2.lines.count-1 do begin
+ s:=memo2.lines[i];
+ if s='' then
+ continue;
+ personen.add(erstesArgument(s,':'));
+ while s<>'' do begin
+ knTag:=tage.findeZeile(erstesArgument(s));
+ if knTag<0 then
+ exit;
+ knZeit:=erstesArgument(s);
+ while pos(',',knZeit)>0 do
+ knZeit[pos(',',knZeit)]:=' ';
+ while pos('-',knZeit)>0 do begin
+ t:=knZeit;
+ knZeit:='';
+ while pos(' ',t+' ') < pos('-',t) do
+ knZeit:=knZeit+' '+erstesArgument(t);
+ try
+ j:=strToInt(erstesArgument(t,'-'));
+ k:=strToInt(erstesArgument(t));
+ except
+ exit;
+ end;
+ while j<k do begin
+ knZeit:=knZeit+' '+intToStr(j);
+ inc(j);
+ end;
+ knZeit:=knZeit+' '+t;
+ end;
+ knZeit:=trim(knZeit);
+ while knZeit<>'' do begin
+ try
+ j:=strToInt(erstesArgument(knZeit)) - spinEdit1.value;
+ except
+ exit;
+ end;
+ if (j<0) or (j>=length(kannNicht)) then
+ exit;
+ setLength(kannNicht[j][knTag],length(kannNicht[j][knTag])+1);
+ kannNicht[j][knTag][length(kannNicht[j][knTag])-1]:=personen.count-1;
+ end;
end;
end;
inhaltOk:=
- (personen.count>0) and
(tage.count>0) and
(length(zeiten)>0);
end;