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

Langage Delphi Discussion :

Erreur E/S 32


Sujet :

Langage Delphi

  1. #1
    Membre averti
    Avatar de jmjmjm
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2005
    Messages
    760
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2005
    Messages : 760
    Points : 439
    Points
    439
    Par défaut Erreur E/S 32
    Que signifie cette erreur svp ??

    Pk cette source me renvoie une erreur au deuxieme appel premier impecable mais second sa merde si qqun pe m'expliquer

    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
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
     
    procedure TPrincipale.Button2Click(Sender: TObject);
    var
    F:TextFile;
    s : array[1..6] of string;
    i,j,h:byte;
    somme:integer;
    OK:integer;
    stop:integer;
    FileHandle:integer;
    niv : byte;
    label termine;
    begin
    stop:=0;
    for h:=11 to 99 do begin
        if (h<>10) and (h<>20) and (h<>30) and (h<>40) and (h<>50) and (h<>60) and (h<>70) and (h<>80) and (h<>90) and (h>10) then begin
            if bouton[h].Caption = '' then stop:=stop+1;
            if stop <> 0 then begin
                ShowMessage('Vous n''avez pas terminée!!');
                goto termine;
                end
     
        end;
    end;
                OK:=0;
                for i:=1 to 9 do begin
                    Somme:=0;
                    for j:=1 to 9 do Somme := strtoint(bouton[Tableau[i,j]].Caption) + Somme;
                    if Somme<>45 then OK:=OK+1;
                    end;
     
                    for i:=1 to 9 do begin
                    Somme:=0;
                    for j:=1 to 9 do Somme := strtoint(bouton[Tableau[j,i]].Caption) + Somme;
                    if Somme<>45 then OK:=OK+1;
                    end;
     
                    for i:=1 to 9 do begin
                    Somme:=0;
                    for j:=1 to 9 do Somme:=strtoint(bouton[j+10*i].Caption)+Somme;
                    if Somme<>45 then OK:=OK+1;
                    end;
     
                    Timer1.Enabled:=false;
                    if OK=0 then begin
                        ShowMessage('Félicitation vous avez gagné en '+inttostr(temp-1)+' s!!');
                        if not FileExists(fichier) then begin
                            FileHandle :=FileCreate(fichier);
                            Fileclose(FileHandle);
                            Assignfile(F,fichier);
                            Rewrite(F);
                            for i:=1 to 6 do writeln(F,'0');
                            CloseFile(F);
                        end;
                        Assignfile(F,fichier);
                        Reset(F);
                        for i:=1 to 6 do Readln(F,s[i]);
                        CloseFile(F);
     
                        niv:=0;
                        if Dbutant1.Checked = true then niv:=1;
                        if Intermediaire1.Checked = true then niv:=2;
                        if Expert1.Checked = true then niv:=3;
     
                        case niv of
                            1 :    if (s[2]='0') or ((s[2]<>'0') and (temp<strtoint(s[2]))) then begin
                                      nom.visible:=true;
                                      repeat
                                          Application.HandleMessage;
                                      until fin=2;
                                      fin:=0;
                                      s[1]:=nom.edit1.Text;
                                      s[2]:=inttostr(temp);
                                      Assignfile(F,fichier);
                                      Reset(F);
                                      Rewrite(F);
                                      for i:=1 to 6 do writeln(F,s[i]);
                                      CloseFile(F);
                                   end;
     
                            2 :    if (s[4]='0') or ((s[4]<>'0') and (temp<strtoint(s[4]))) then begin
                                      nom.visible:=true;
                                      repeat
                                          Application.HandleMessage;
                                      until fin=2;
                                      fin:=0;
                                      s[3]:=nom.edit1.Text;
                                      s[4]:=inttostr(temp);
                                      Assignfile(F,fichier);
                                      Reset(F);
                                      Rewrite(F);
                                      for i:=1 to 6 do writeln(F,s[i]);
                                      CloseFile(F);
                                   end;
     
                            3 :    if (s[6]='0') or ((s[6]<>'0') and (temp<strtoint(s[6]))) then begin
                                      nom.visible:=true;
                                      repeat
                                          Application.HandleMessage;
                                      until fin=2;
                                      fin:=0;
                                      s[5]:=nom.edit1.Text;
                                      s[6]:=inttostr(temp);
                                      Assignfile(F,fichier);
                                      Reset(F);
                                      Rewrite(F);
                                      for i:=1 to 6 do writeln(F,s[i]);
                                      CloseFile(F);
                                   end;
     
                        end;
     
     
     
                    end
                    else ShowMessage('Vous avez perdu!!');
                    for i:=1 to 99 do begin
                        if (i<>10) and (i<>20) and (i<>30) and (i<>40) and (i<>50) and (i<>60) and (i<>70) and (i<>80) and (i<>90) and (i>10) then Bouton[i].Enabled:=false;
                    end;
     
    termine:
    end;

  2. #2
    Membre confirmé
    Avatar de lil_jam63
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    447
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 447
    Points : 600
    Points
    600
    Par défaut
    C'est une erreur de violation d'accès ( ERROR_SHARING_VIOLATION) ton fichier est déjà utilisé par un autre processus quand tu essayes d'y acceder.
    Ce qui explique l'erreur au deuxième accès, tu dois oublier de le refermer à un moment ou un autre.
    Tu as essayé en mode pas à pas de voir où ça plante?

  3. #3
    Rédacteur
    Avatar de Pedro
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    5 411
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 5 411
    Points : 8 078
    Points
    8 078
    Par défaut
    Salut
    Si c'est un fichier texte, utilise plutot une TStringList... C'est beaucoup plus simple à gérer

Discussions similaires

  1. Erreur fréquente avec ASP et IIS
    Par Community Management dans le forum ASP
    Réponses: 2
    Dernier message: 11/02/2004, 22h20
  2. Check Url pour savoir si erreur 404 ou si le site existe
    Par Clément[Delphi] dans le forum Composants VCL
    Réponses: 2
    Dernier message: 07/08/2002, 13h49
  3. Réponses: 2
    Dernier message: 27/05/2002, 19h46
  4. erreur IDL:omg.org/CORBA/MARSHAL:1.0
    Par Pinggui dans le forum CORBA
    Réponses: 3
    Dernier message: 13/05/2002, 15h05
  5. [Kylix] Erreur objet
    Par Anonymous dans le forum EDI
    Réponses: 1
    Dernier message: 22/03/2002, 09h41

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