Autor Beitrag
LAVA
Hält's aus hier
Beiträge: 1



BeitragVerfasst: So 21.09.03 10:23 
bin eine mirc dll am proggen um ein schnelleres $findfile zu ermöglichen,
hatte soweit auch schon alles am laufen, hab ein paar sachen hinzugefügt und jetzt gehts nich mehr...:
ausblenden volle Höhe Delphi-Quelltext
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:
library Project1;

uses
  Windows, SysUtils, Classes;

function findfile(mWnd, aWnd: HWND; data, parms: PChar; show, nopause:boolean):integer; stdcall;
var
  SearchRec: TSearchRec;
  s1,s2,s3,s4,s5: String;
  Strlst: TStringList;
  z1,z2,z3,tfiles,tsize,z4,y4,x4: Integer;
begin
  z1 := 0;
  z2 := 0;
  z3 := 1;
  Strlst := TStringlist.Create;
  try Strlst.Delimiter := ' ';
    Strlst.DelimitedText := data;
    s1 := Strlst[0];
    s2 := Strlst[1];
    s3 := Strlst[2];
    finally FreeAndNil(Strlst);
  end;
  FindFirst(s1 + s2, faAnyFile, SearchRec);
  if (SearchRec.Name = ''then else begin
    while (z3 = 1do begin
      FindNext(SearchRec);
      if (SearchRec.Name = s4)
      then z3 := 0
      else begin
        s4 := SearchRec.Name;
        z2 := z2 + SearchRec.Size;
        z1 := z1 + 1
      end;
    end;
  end;
  tfiles := z1;
  tsize := z2;
  z3 := 1;
  if (tfiles < StrToInt(s3)) then z3 := 0;
  FindFirst(s1 + s2, faAnyFile, SearchRec);
  z1 := z1 + 1;
   if (StrToInt(s3) > z1) then begin
      while (z3 = 1do begin
        FindNext(SearchRec);
        if (SearchRec.Name = s4) then begin
          z3 := 0;
          s4 := '';
        end
        else begin
          s4 := SearchRec.Name;
          z4 := SearchRec.Size;
          y4 := SearchRec.Time;
          x4 := SearchRec.Attr;
          z1 := z1 + 1;
        end;
      end;
    s5 := s4 + '' + IntToStr(z4) + '' + IntToStr(y4) + '' + IntToStr(x4);
    StrCopy(data,PAnsiChar(s5));
    Result := 3
  end;
end;

exports
  findfile;

{$R *.RES}

begin
end.

kriege folgende fehlermeldungen:
Delphi hat folgendes geschrieben:
[Hint] Project1.dpr(15): Value assigned to 'z3' never used
[Hint] Project1.dpr(14): Value assigned to 'z2' never used
[Hint] Project1.dpr(13): Value assigned to 'z1' never used
[Warning] Project1.dpr(25): Return value of function 'findfile' might be undefined
[Hint] Project1.dpr(9): Variable 's4' is declared but never used in 'findfile'
[Hint] Project1.dpr(9): Variable 's5' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'tfiles' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'tsize' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'z4' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'y4' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'x4' is declared but never used in 'findfile'

was könnte ich da falsch gemacht haben?

Moderiert von user profile iconTino: Delphi- & Quote-Tags hinzugefügt; Titel geändert.
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 21.09.03 11:09 
Titel: Re: dll builden
LAVA hat folgendes geschrieben:
kriege folgende fehlermeldungen:
[Hint] Project1.dpr(15): Value assigned to 'z3' never used
[Hint] Project1.dpr(14): Value assigned to 'z2' never used
[Hint] Project1.dpr(13): Value assigned to 'z1' never used
[Warning] Project1.dpr(25): Return value of function 'findfile' might be undefined
[Hint] Project1.dpr(9): Variable 's4' is declared but never used in 'findfile'
[Hint] Project1.dpr(9): Variable 's5' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'tfiles' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'tsize' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'z4' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'y4' is declared but never used in 'findfile'
[Hint] Project1.dpr(11): Variable 'x4' is declared but never used in 'findfile'

Kannst du das denn nicht übersetzen?

Der Compiler sagt dir damit, dass du eine tickende Zeitbombe (Warning) und viele unnütze Zuweisungen (die Hints) hast.


Zudem gibt es in diesem Forum die [ delphi ] [ /delphi ] Tags (ohne die Leerzeichen).

_________________
Ist Zeit wirklich Geld?