program Test;
var
i : Integer;
k : Integer;
s : String;
sCase : String;
procedure Dubletten;
begin
GetSelText;
s := '';
for i := 0 to SelText.Count - 1 do begin
if s = Copy(SelText[i],1,6) then begin
WriteLn(Format('Dublette %s',[Copy(SelText[i],1,6)]));
WriteLn(Format('Dublette %s',[Copy(SelText[i - 1],8,4096)]));
WriteLn(Format('Dublette %s',[Copy(SelText[i],8,4096)]));
end;
s := Copy(SelText[i],1,6);
end;
end;
procedure CaseErstellen;
begin
GetSelText;
k := 0;
s := AnsiReplaceText(Copy(SelText[0],8,4096),'''',''''' ');
s := '';
sCase := '';
for i := 0 to SelText.Count - 1 do begin
if s <> AnsiReplaceText(Copy(SelText[i],8,4096),'''',''''' ') then begin
WriteLn(Format(' %s: Result := ''%s'';',[sCase,s]));
s := AnsiReplaceText(Copy(SelText[i],8,4096),'''',''''' ');
sCase := '$' + Copy(SelText[i],1,6);
end else begin
if Length(sCase) = 70 then begin
WriteLn(Format(' %s,',[sCase]));
sCase := '';
end;
if sCase = '' then sCase := '$' + Copy(SelText[i],1,6) else sCase := sCase + ', $' + Copy(SelText[i],1,6);
end;
end;
WriteLn(Format(' %s: Result := ''%s'';',[sCase,s]));
end;
procedure InitErstellen;
begin
GetSelText;
k := 0;
for i := 0 to SelText.Count - 1 do begin
if (i mod 500 = 0) then begin
if i > 0 then begin
WriteLn('end;');
WriteLn('');
end;
Output.Add(Format(' procedure Init%0.3d;',[k]));
WriteLn(Format('procedure tNMap_Mac_List.Init%0.3d;',[k]));
WriteLn('begin');
k := k + 1;
end;
WriteLn(Format(' fHex.Add(''%s''); fName.Add(''%s'');',[Copy(SelText[i],1,6),AnsiReplaceText(Copy(SelText[i],8,4096),'''',''''' ')]));
end;
WriteLn('end;');
end;
begin
// InitErstellen;
// CaseErstellen;
Dubletten;
end.