IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Delphi Discussion :

Erreur "Type Record, Object ou Class requis"


Sujet :

Delphi

  1. #1
    Futur Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 13
    Points : 9
    Points
    9
    Par défaut Erreur "Type Record, Object ou Class requis"
    Bonsoir à tous

    Voilà je suis un débutant dans le domaine de delphi et j'essaie de faire un petit programme, cependant j'ai des erreurs quand je veux exécuter mon application

    [Erreur] Unit1.pas(62): Type Record, Object ou Class requis
    [Erreur] Unit1.pas(78): 'END' attendu(e) mais fin de fichier trouvé(e)

    voici le contenu de unit1.pas

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Buttons, ShellApi;
     
    type
      TForm1 = class(TForm)
        SpeedButton1: TSpeedButton;
        procedure SpeedButton1Click(Sender: TObject);
      private
        { Déclarations privées }
      public
        { Déclarations publiques }
      end;
     
    var
      Form1: TForm1;
       SEInfo: TShellExecuteInfo;
       ExitCode: DWORD;
       ExecuteFile, ParamString, StartInString: string;
     
    implementation
     
    uses Unit2, Unit3;
     
    {$R *.dfm}
     
    procedure TForm1.SpeedButton1Click(Sender: TObject);
    begin
    With form2 do
    begin
    show;
    end;
    begin
    ExecuteFile:='search.exe';
      FillChar(SEInfo, SizeOf(SEInfo), 0) ;
    SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
    with SEInfo do begin
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Application.Handle;
    lpFile := PChar(ExecuteFile) ;
     
    nShow := SW_SHOWNORMAL;
    end;
    if ShellExecuteEx(@SEInfo) then begin
    repeat
    Application.ProcessMessages;
    GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
    until (ExitCode <> STILL_ACTIVE) or
    Application.Terminated;
    showMessage('ok');
    end
    begin
    With form2 do
    begin
    close;
    end;
     
    begin
    With form3 do
    begin
    show;
    end;
    end.
    Merci pour votre aide

  2. #2
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    argh

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    procedure TForm1.SpeedButton1Click(Sender: TObject);
    begin
    {
     With form2 do
     begin
      show;
     end;
    }
     Form2.Show;
     
    // begin ???!!!
     ExecuteFile:='search.exe';
     FillChar(SEInfo, SizeOf(SEInfo), 0) ;
     SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
     with SEInfo do begin
      fMask := SEE_MASK_NOCLOSEPROCESS;
      Wnd := Application.Handle;
      lpFile := PChar(ExecuteFile) ;
      nShow := SW_SHOWNORMAL;
     end;
     if ShellExecuteEx(@SEInfo) then begin
      repeat
       Application.ProcessMessages;
       GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
      until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
      showMessage('ok');
     end;
    // begin ???!!
    {
    With form2 do
    begin
    close;
    end;
    }
      Form2.Close;
     
    // begin ???!!!
    {
    With form3 do
    begin
    show;
    end;
    }
     Form3.Show;
    end; // ";" et pas "."
    où est l'erreur (soit je suis pas réveillé, soit elle est pas là)
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  3. #3
    Membre du Club Avatar de milaybe
    Inscrit en
    Décembre 2007
    Messages
    58
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 58
    Points : 58
    Points
    58
    Par défaut
    Je ne sais pas ce que tu essaie de faire mais essaie avec ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Buttons, ShellApi;
     
    type
      TForm1 = class(TForm)
        SpeedButton1: TSpeedButton;
        procedure SpeedButton1Click(Sender: TObject);
      private
        { Déclarations privées }
      public
        { Déclarations publiques }
      end;
     
    var
      Form1: TForm1;
       SEInfo: TShellExecuteInfo;
       ExitCode: DWORD;
       ExecuteFile, ParamString, StartInString: string;
     
    implementation
     
    uses Unit2, Unit3;
     
    {$R *.dfm}
     
    procedure TForm1.SpeedButton1Click(Sender: TObject);
    begin
      With form2 do
      begin
        show;
      end;
      ExecuteFile:='search.exe';
      FillChar(SEInfo, SizeOf(SEInfo), 0) ;
      SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
      with SEInfo do 
      begin
        fMask := SEE_MASK_NOCLOSEPROCESS;
        Wnd := Application.Handle;
        lpFile := PChar(ExecuteFile) ;
        nShow := SW_SHOWNORMAL;
      end;
      if ShellExecuteEx(@SEInfo) then 
      begin
        repeat
           Application.ProcessMessages;
           GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
        until (ExitCode <> STILL_ACTIVE) or
        Application.Terminated;
        showMessage('ok');
      end
      else
      begin
         With form2 do
         begin
            close;
         end;
      end;
      With form3 do
      begin
        show;
      end;
    end.
    Et peux-tu indiquer, lorsque tu executes ce code, où s'arrête le curseur?
    Help, Déboguer = solutions

  4. #4
    Membre du Club Avatar de milaybe
    Inscrit en
    Décembre 2007
    Messages
    58
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 58
    Points : 58
    Points
    58
    Par défaut
    où est l'erreur (soit je suis pas réveillé, soit elle est pas là)
    J'aimerais bien savoir ce qu'il veut faire
    Help, Déboguer = solutions

  5. #5
    Membre expérimenté Avatar de guillemouze
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    876
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Novembre 2004
    Messages : 876
    Points : 1 448
    Points
    1 448
    Par défaut
    mais j'hallucine, on m'a piqué mon avatar

  6. #6
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    Citation Envoyé par guillemouze Voir le message
    mais j'hallucine, on m'a piqué mon avatar
    remarque, y'a pas vraiment de quoi en être fier
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

Discussions similaires

  1. Réponses: 1
    Dernier message: 11/07/2013, 21h51
  2. E2018 Type Record, Object ou Class requis
    Par Skrins dans le forum Bases de données
    Réponses: 9
    Dernier message: 23/04/2013, 12h12
  3. [1.x] erreur "no description for object of class" ?
    Par symfony30000 dans le forum Symfony
    Réponses: 3
    Dernier message: 16/03/2010, 11h41
  4. Type as OBJECT peut il etre multi-record
    Par ana saadi dans le forum SQL
    Réponses: 2
    Dernier message: 10/08/2007, 12h25
  5. type record, objerct ou classe requis ?
    Par babou54 dans le forum Delphi
    Réponses: 3
    Dernier message: 10/01/2007, 14h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo