Delphi-PRAXiS
Seite 2 von 3     12 3      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Komplette Partition C: (https://www.delphipraxis.net/72637-komplette-partition-c.html)

I.A. 4. Jul 2006 14:37

Re: Komplette Partition C:
 
Ok werd ich mal versuchen :mrgreen:

bis jetzt hat so was noch nie bei mir geklappt
des ging au net:
Delphi-Quellcode:
function GetWinVersion: string;
begin
  result:='Unbekannte Version';
  case Win32Platform of
    1:// 9x-Reihe
      If Win32MajorVersion=4 Then Begin
        Case Win32MajorVersion of
            0: result:='Windows 95';
            10: result:='Windows 98';
            90: result:='Windows Me';
        end;
      end;
  2: // NT-Reihe
     Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
           end;
     End;
  end;
  //Win32CSDVersion enthält Informationen zu Servicepacks
  if Win32CSDVersion<>'' then
    result:=result+' '+Win32CSDVersion;
end;
da war immer das Get Windows rot.


naja ich werds mal versuchen.

Smeivel 4. Jul 2006 14:44

Re: Komplette Partition C:
 
Das solltest du in einem eigenen Thread behandeln da atimmt noch nicht einmal die erste Zeile:
Delphi-Quellcode:
function GetWinVersion: string;

gmc616 4. Jul 2006 14:53

Re: Komplette Partition C:
 
Was soll daran falsch sein? :gruebel:

Irgendwie habe ich das gefühl das I.A. gern die Deklaration der Funktionen und Proceduren vergisst, bzw. fehlende Units einzubinden.

Verleicht sollte er sich mal das Einsteiger-Tutorial der Schweizer anschauen.

I.A. 4. Jul 2006 17:37

Re: Komplette Partition C:
 
Ich habe einfach den Delphi Code von

http://www.dsdt.info/news/ds/

dsdt.info

kopiert

Smeivel 4. Jul 2006 17:55

Re: Komplette Partition C:
 
Oh ja tut mir leid Denkfehler von mir dachte bei Funktionen kommen auch klammern drum hats denn mit meinem Quelltext funktioniert?

I.A. 4. Jul 2006 18:14

Re: Komplette Partition C:
 
So habe ich das von dir kopiert und eingesetzt aber da ist immer noch Puplic und GetFiles rot unterstrichen.

Delphi-Quellcode:
public
     procedure GetFiles(const Path: string);
   { Public-Deklarationen }


procedure TForm1.GetFiles(const Path: string);
var
  SearchRec: TSearchRec;
  p: string;

begin
     Label1.Caption:='';
     p := path + '*.*';
     if FindFirst(p, faAnyFile, SearchRec) = 0 then
     begin
      repeat
        if (SearchRec.Attr and faDirectory) = faDirectory then
        begin
         if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
           GetFiles(Path + SearchRec.Name + '\');
           end
        else begin
        Form1.Memo1.Lines.Add(Path + SearchRec.Name);
        a:=a+1;
        Refresh;
        Application.ProcessMessages;
        ProgressBar1.StepIt;
        end;
      until
        FindNext(SearchRec) <> 0;
      FindClose(SearchRec);
     end;
     ProgressBar1.Position:=0;
     Label1.Caption:=IntToStr(a) +' Dateien gescannt';
Das war deins jetzt gebe ich den Komletten Code so wie er bei mir da steht :
Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    Memo1: TMemo;
    SaveDialog1: TSaveDialog;
    FileListBox1: TFileListBox;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FileListBox1Change(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  a:integer;

implementation

{$R *.dfm}

procedure TForm1.FileListBox1Change(Sender: TObject);
begin
FileListBox1.ApplyFilePath('C:\');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
savedialog1.Execute;
memo1.Lines.savetofile(savedialog1.filename+ '.mp3');
end;

public
     procedure GetFiles(const Path: string);
   { Public-Deklarationen }


procedure TForm1.GetFiles(const Path: string);
var
  SearchRec: TSearchRec;
  p: string;

begin
     Label1.Caption:='';
     p := path + '*.*';
     if FindFirst(p, faAnyFile, SearchRec) = 0 then
     begin
      repeat
        if (SearchRec.Attr and faDirectory) = faDirectory then
        begin
         if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
           GetFiles(Path + SearchRec.Name + '\');
           end
        else begin
        Form1.Memo1.Lines.Add(Path + SearchRec.Name);
        a:=a+1;
        Refresh;
        Application.ProcessMessages;
        ProgressBar1.StepIt;
        end;
      until
        FindNext(SearchRec) <> 0;
      FindClose(SearchRec);
     end;
     ProgressBar1.Position:=0;
     Label1.Caption:=IntToStr(a) +' Dateien gescannt';
end;

end;

end.

Smeivel 4. Jul 2006 18:27

Re: Komplette Partition C:
 
Also du musst dir nochmal genauer anschauen wie das mit den privaten prozeduren läuft, es sollte nämlich eigentlich so bei dir aussehen, wie ich dass in meinem Beitrag #10 bereits gepostet habe nimm dass mal dass muss funktionieren habs selber getestet! Kann dir jetzt leider keinen Link zu dem Thread schicken wo private prozeduren genauer beschrieben werden

I.A. 4. Jul 2006 18:42

Re: Komplette Partition C:
 
Ja der funktioniert bei mir fast aber da hast du das gemacht :
Delphi-Quellcode:
procedure ....................;
procedure ....................;
procedure ....................;
die ersten 2 proceduren hab ich schon nämlich :
Delphi-Quellcode:
procedure BitBtn2Click(Sender: TObject);
procedure GetFiles(const Path: string;
procedure ;
aber die dritte procedure find ich nicht.

xZise 4. Jul 2006 19:18

Re: Komplette Partition C:
 
Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    Memo1: TMemo;
    SaveDialog1: TSaveDialog;
    FileListBox1: TFileListBox;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FileListBox1Change(Sender: TObject);
  public
    procedure GetFiles(const Path: string);
  end;

{...}
So sollte der Kopf aussehen ^^

Und dann die Erklärung:
Delphi-Quellcode:
unit {Unitname};

interface

uses
  {Benötigte/Imporitiere Dateien (mist :( Mir fällt das Wort dafür gerad nich ein :()};

type //Klasse
  {Name} = class({Elternklasse})
    {Funktionen/Prozedurendeklarationen // Setzen d. Variablen}
  end;
Aso:
Du kannst nicht irgendwoe im Code "procedure GetFiles(const Path: string);" reinschreiben, sonder das MUSS immer vor implentation ;)

Smeivel 4. Jul 2006 19:24

Re: Komplette Partition C:
 
Nein tut mir Leid du hast das Falsch verstanden das sollte keine Anzahl darstellen sondern einfach nur ein Platzhalter sein für deine anderen Prozeduren hast das so richtig gemacht. Was willst du überhaupt mit deinem Programm erreichen? bzw. was macht es?


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:08 Uhr.
Seite 2 von 3     12 3      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz