Aider moi svp (Language Pascal)

Bonjour,
j'ai fait in program avec pascal et ça va marché mais en exécution il me renvoie un message :" ..Caused a General Protection Fault in Module soh.exe At 003:0A01"
alors je sais pas pourquoi et comment peux je resoudre ce problem?et meerci d'avance :)

4 réponses

  1. ce genre de message n'est pas très clair. En gros ça veut dire qu'il y a une erreur d'utilisation de la mémoire, c'est très vague, ça peut venir de

    * une variable mal utilisée
    * plus précisément un problème de tableau (par exemple essayer d'accéder à un élément d'un tableau qui n'existe pas
    * ou encore un problème de pointeur mal initialisé
    * et d'autres.

    Donc il faudrait au moins que vous puissiez copier les lignes de code qui déclenchent le problème.
    1
    1. meeeeeeeeercii bbcp de votre reponse mon ami c ça le code c'est un program de cryptage des chaines de caractère ^^ :
      ------------------------------------------------------------
      program cryptage;

      uses
      wincrt;

      type
      car = record
      carac: string;
      cod: string;
      end;
      tab = array [1..30] of car;
      tab2 = array[1..30] of string;
      fichier = file of car;
      {------------------------------Delclaration---------------------------------------------------}
      var
      ft_dic: fichier;
      t: tab;
      i: integer;
      te: string;
      ft_sor: Text;
      t2: tab2;

      {-----------------------------------Le dictionnaire Utiliser----------------------------------}
      procedure dict(var ft_dic: fichier; var t: tab);
      var
      i: integer;
      begin
      for i := 97 to 122 do
      begin
      with t[i] do
      begin
      carac := chr(i);
      cod := chr(random(32) + 33) + chr(random(58) + 65);
      end;
      end;
      MKdir('c:\crypter');
      Assign(ft_dic, 'C:\crypter\stub.crp');
      rewrite(ft_dic);
      for i := 97 to 122 do
      begin
      Write(ft_dic, t[i]);
      end;
      Close(ft_dic);
      end;

      {---------------------------------Affichage Du dectionnaire-----------------------------------}
      procedure affich_dec(var ft_dic: fichier);
      var
      e: car;
      begin
      reset(ft_dic);
      for i := 1 to 27 do
      begin
      Read(ft_dic, e);
      Write(e.carac, ' = ');
      Write(e.cod, '||');
      end;
      Close(ft_dic);
      end;

      {--------------------------------Convertion---------------------------------------------------}
      function convertion(c: string; var ft_dic: fichier): string;
      var
      i: integer;
      e: car;
      begin
      reset(ft_dic);
      i := 0;
      repeat
      i := i + 1;
      Read(ft_dic, e);
      until (e.carac = c);
      if e.carac = c then
      begin
      c := e.cod;
      end;
      convertion := c;
      Close(ft_dic);
      end;

      {--------------------------------Le Cryptage De ton code--------------------------------------}
      procedure crypter(var te: string; var ft_sor: Text; var ft_dic: fichier; var t2: tab2);
      var
      path, c, ch: string;
      begin
      writeln('Entrer La destination de ton fichier à crypter:');
      MKdir('c:\Cryptage');
      writeln('(c:\Cryptage\[nom_fichier].*txt');
      readln(path);
      if (path = '') or (chr(length(path) - 4) <> '.') then
      begin
      writeln('ta destination est vide!!');
      end
      else
      begin
      Assign(ft_sor, path);
      rewrite(ft_sor);
      for i := 1 to length(te) do
      begin
      c := te[i] + '';
      c := convertion(c, ft_dic);
      t2[i] := c;
      end;
      ch := '';
      for i := 1 to length(te) do
      begin
      ch := ch + t2[i];
      end;
      writeln(ft_sor, ch);
      Close(ft_sor);
      end;
      end;

      {---------------------------------------Le programme Principale--------------------------------}
      begin
      writeln('*********Created By Xhacker..Tunisia is my life: L''islam is my religion*********');
      writeln('*****2010-2011******');
      writeln('All rights reserved!!');
      writeln;
      dict(ft_dic, t);
      affich_dec(ft_dic);
      writeln('Entrer Ton Code à crypter:');
      readln(te);
      crypter(te, ft_sor, ft_dic, t2);
      end.
      ----------------------------------------------------------
      ----------------------------------------------------------
      Alors svp si vous pouver m'aider à resoudre les problems? et meeeerci infiniment et je suis encore debutant nespa? lool mais j'aime tjs explorer c'est chose là :)) ^^ et heureu de vous rencontre aussi :))
      0
      1. ...
        tab = array [1..30] of car;
        ...
        {------------------------------Delclaration---------------------------------------------------}
        ...
        
        {-----------------------------------Le dictionnaire Utiliser----------------------------------}
        procedure dict(var ft_dic: fichier; var t: tab);
        var
        i: integer;
        begin
        for i := 97 to 122 do
        begin
        with t[i] do
        begin 


        tu vois le problème avec le tableau ?

        essaye de bien corriger partout si tu utilises correctement ton tableau...
        1
        1. meeeeeeeeeeeeeerciiii meeeeeeeeeeeeeerciiii infiniment et de mon coeur ça marche trés bien ^^ :))))))) c'est trop gentille de votre part mr :))) ^^
          0
        2. ok, je suis content d'avoir pu t'aider ! ^_^

          Bonne continuation

          (PS : n'oublie pas mettre ton sujet en "résolu"
          0
        3. meerci encoor :)) mmais bon lool j'ai eu un autre eurreur hhhh: un message me dit :"Error 202 at.." c'est le code encor:
          program cryptage;
          uses wincrt;
          type car=record
          carac:string;
          cod:string;
          end;
          tab=array [1..50]of car;
          tab2=array[1..50]of string;
          fichier=file of car;
          {------------------------------Delclaration---------------------------------------------------}
          var ft_dic:fichier;
          t:tab;
          i:integer;
          te:string;
          ft_sor:text;
          t2:tab2;
          {-----------------------------------Le dictionnaire Utiliser----------------------------------}
          procedure dict(var ft_dic:fichier;var t:tab);
          var i:integer;
          begin
          for i:=1 to 27 do
          begin
          with t[i] do
          begin
          carac:=chr(i+64);
          cod:=chr(random(32)+33)+chr(random(58)+65);
          end;
          end;
          MKdir('c:\crypter');
          assign(ft_dic,'C:\crypter\stub.crp');
          rewrite(ft_dic);
          for i:=1to 27do
          begin
          write(ft_dic,t[i]);
          end;
          close(ft_dic);
          end;
          {---------------------------------Affichage Du dectionnaire-----------------------------------}
          procedure affich_dec(var ft_dic:fichier);
          var e:car;
          begin
          reset(ft_dic);
          for i:=1 to 27 do
          begin
          read(ft_dic,e);
          write(e.carac,' = ');
          write(e.cod,'||');
          end;
          close(ft_dic);
          end;
          {--------------------------------Convertion---------------------------------------------------}
          function convertion(c:string;t:tab):string;
          var i:integer;
          c1:string;
          begin
          i:=0;
          repeat
          i:=i+1;
          until((t[i].carac=c)or(i>=27));
          if t[i].carac=c then
          begin
          delete(c,1,length(c));
          c1:=t[i].cod;
          end;
          convertion:=c1;
          end;

          {--------------------------------Le Cryptage De ton code--------------------------------------}
          procedure crypter(var te:string;var ft_sor:text;var ft_dic:fichier;var t2:tab2;t:tab);
          var path,c,c1,ch:string;
          begin
          writeln('votre Fichier Destination est cetuer dans:');
          MKdir('c:\Cryptage');
          writeln('(c:\Cryptage\Cryptée.txt');
          assign(ft_sor,'c:\Cryptage\Cryptée.txt');
          rewrite(ft_sor);
          for i:=1 to length(te)do
          begin
          c:=te[i];
          c1:=convertion(c,t);
          t2[i]:=c1;
          end;
          ch:='';
          for i:=1 to length(te)do
          begin
          ch:=ch+t2[i];
          end;
          writeln(ft_sor,ch);
          close(ft_sor);
          end;
          {---------------------------------------Le programme Principale--------------------------------}
          begin
          writeln('All rights reserved!!');
          writeln;
          dict(ft_dic,t);
          affich_dec(ft_dic);
          writeln;
          writeln('Entrer Ton Code à crypter:');
          readln(te);
          crypter(te,ft_sor,ft_dic,t2,t);
          end.
          0
        4. alors pouvez vous me resoudre ce problem? :) et meerci encoor ^^
          0
        5. je suis sur que cette eurreur est dans les deux procedures convertion ou bien Cryptage pleaaase aider moi :((
          0
      2. il n'ya pas d'aide svp? :((
        0
        1. error 202 at quoi ?

          que signifie l'erreur 202 dans ton compilateur ?

          comment sais-tu que c'est dans la procédure cryptage ou conversion ?
          0