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

Caml Discussion :

[PROBLEME] Compilation : erreur, mais je ne sais pas la corriger !


Sujet :

Caml

  1. #1
    telodo
    Invité(e)
    Par défaut [PROBLEME] Compilation : erreur, mais je ne sais pas la corriger !
    Bonsoir a tous,

    Tout d'abords, merci de l'importance et du temps que vous m'accordez.


    Je tente de compiler un petit programme, cependant j'ai une erreure : Unbound value moveto


    Je me permet de vous presenter le code source :

    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
     
    let yg x y z=moveto x y;
    set_color black;
    fill_circle x y z;
    set_color white;
    fill_rect x (y-z) (2*z) (2*z);
    fill_circle x (y+z/2) (z/2);
    set_color black;
    fill_circle x (y-z/2) (z/2);
    draw_circle x y z;
    fill_circle x (y+z*2/3) (z/7);
    set_color white;
    fill_circle x (y-z*2/3) (z/7);;
    let mess x y=
    set_color black;
    moveto x y;
    lineto x (y+30);
    moveto x (y+15);
    lineto (x+5) (y+15);
    lineto (x+5) (y+30);
    lineto (x+5) (y-30);
    moveto (x+10) y;
    lineto (x+12) (y+30);
    lineto (x+15) (y+13);
    lineto (x+12) (y+13);
    moveto (x+15) (y+13);
    lineto (x+15) y;
    moveto (x+25) (y+15);
    lineto (x+20) (y+15);
    lineto (x+20) y;
    lineto (x+25) y;
    moveto (x+30) y;
    lineto (x+30) (y+30);
    moveto (x+30) (y+15);
    lineto (x+35) (y+30);
    moveto (x+30) (y+15);
    lineto (x+35) y;
    moveto (x+40) y;
    lineto (x+45) y;
    moveto (x+47) y;
    lineto (x+47) (y+29);
    lineto (x+44) (y+30);
    moveto (x+47) (y+29);
    lineto (x+50) (y+30);
    moveto (x+55) y;
    lineto (x+55) (y+30);
    moveto (x+55) (y+15);
    lineto (x+60) (y+15);
    lineto (x+60) (y+30);
    lineto (x+60) (y-30);
    moveto (x+70) y;
    lineto (x+65) y;
    lineto (x+65) (y+15);
    lineto (x+72) (y+15);
    moveto (x+65) (y+15);
    lineto (x+65) (y+30);
    lineto (x+70) (y+30);
    moveto (x+75) y;
    lineto (x+80) y;
    moveto (x+85) y;
    lineto (x+85) (y+30);
    lineto (x+87) (y+26);
    lineto (x+87) (y+23);
    lineto (x+85) (y+17);
    lineto (x+85) (y+13);
    lineto (x+87) (y+8);
    lineto (x+87) (y+5);
    lineto (x+85) y;
    moveto (x+90) y;
    lineto (x+90) (y+30);
    lineto (x+92) (y+26);
    lineto (x+92) (y+23);
    lineto (x+90) (y+17);
    lineto (x+90) (y+13);
    lineto (x+92) (y+8);
    lineto (x+92) (y+5);
    lineto (x+90) y;
    moveto (x+95) y;
    lineto (x+97) y;
    lineto (x+98) (y+3);
    lineto (x+99) (y+5);
    lineto (x+100) (y+10);
    lineto (x+100) (y+15);
    lineto (x+98) (y+20);
    lineto (x+97) (y+25);
    lineto (x+95) (y+30);
    lineto (x+100) (y+30);;
    clear_graph();
    yg 200 200 100;
    mess 400 130;;
    Ca fait deja 2h que je tourne en ronds sur internet.. Je n'en peux plus !

  2. #2
    Membre actif Avatar de Steki-kun
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    222
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 222
    Points : 281
    Points
    281
    Par défaut
    moveto, lineto et leurs amies sont définies dans le modules Graphics, je ne vois nulle part dans ton code de référence à ce module. C'est pourquoi le système te dit qu'il ne sait pas d'où sort moveto !

    Il te faut soit l'ouvrir avec la commande "open Graphics" pour pouvoir utiliser partout les fonctions qui y sont définies, soit (de manière générale, mais ici je te le déconseille) écrire Graphics.moveto, Graphics.lineto, etc, ce qu'on appelle "qualifier" les identificateurs.

  3. #3
    telodo
    Invité(e)
    Par défaut
    Merci beaucoup de votre reponse, je vais aller essayer ca.

  4. #4
    telodo
    Invité(e)
    Par défaut
    A présent j'ai cette erreur (Caml Light pointe sur "let") :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    >let yg x y z=moveto x y;
    Erreur de syntaxe.
    Décidément Je ne vais jamais y arriver !

  5. #5
    alex_pi
    Invité(e)
    Par défaut
    Citation Envoyé par telodo Voir le message
    A présent j'ai cette erreur (Caml Light pointe sur "let") :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    >let yg x y z=moveto x y;
    Erreur de syntaxe.
    Décidément Je ne vais jamais y arriver !
    Vu que c'est la première ligne du code que l'on a déjà, et qu'a priori, tu as rajouté des chose avant, il faudrait nous montrer ce que tu as rajouté avant.

    Et en caml-light, c'est ;; pour conclure un blok d'instruction, pas un simple ;

  6. #6
    telodo
    Invité(e)
    Par défaut
    Donc en fait, j'ai juste rajoute (comme en C) la librairie "Open Graphics" en tete de document. Voici donc ce que j'ai a present :

    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
     
    open Graphics
     
    let yg x y z=moveto x y;
    set_color black;
    fill_circle x y z;
    set_color white;
    fill_rect x (y-z) (2*z) (2*z);
    fill_circle x (y+z/2) (z/2);
    set_color black;
    fill_circle x (y-z/2) (z/2);
    draw_circle x y z;
    fill_circle x (y+z*2/3) (z/7);
    set_color white;
    fill_circle x (y-z*2/3) (z/7);;
    let mess x y=
    set_color black;
    moveto x y;
    lineto x (y+30);
    moveto x (y+15);
    lineto (x+5) (y+15);
    lineto (x+5) (y+30);
    lineto (x+5) (y-30);
    moveto (x+10) y;
    lineto (x+12) (y+30);
    lineto (x+15) (y+13);
    lineto (x+12) (y+13);
    moveto (x+15) (y+13);
    lineto (x+15) y;
    moveto (x+25) (y+15);
    lineto (x+20) (y+15);
    lineto (x+20) y;
    lineto (x+25) y;
    moveto (x+30) y;
    lineto (x+30) (y+30);
    moveto (x+30) (y+15);
    lineto (x+35) (y+30);
    moveto (x+30) (y+15);
    lineto (x+35) y;
    moveto (x+40) y;
    lineto (x+45) y;
    moveto (x+47) y;
    lineto (x+47) (y+29);
    lineto (x+44) (y+30);
    moveto (x+47) (y+29);
    lineto (x+50) (y+30);
    moveto (x+55) y;
    lineto (x+55) (y+30);
    moveto (x+55) (y+15);
    lineto (x+60) (y+15);
    lineto (x+60) (y+30);
    lineto (x+60) (y-30);
    moveto (x+70) y;
    lineto (x+65) y;
    lineto (x+65) (y+15);
    lineto (x+72) (y+15);
    moveto (x+65) (y+15);
    lineto (x+65) (y+30);
    lineto (x+70) (y+30);
    moveto (x+75) y;
    lineto (x+80) y;
    moveto (x+85) y;
    lineto (x+85) (y+30);
    lineto (x+87) (y+26);
    lineto (x+87) (y+23);
    lineto (x+85) (y+17);
    lineto (x+85) (y+13);
    lineto (x+87) (y+8);
    lineto (x+87) (y+5);
    lineto (x+85) y;
    moveto (x+90) y;
    lineto (x+90) (y+30);
    lineto (x+92) (y+26);
    lineto (x+92) (y+23);
    lineto (x+90) (y+17);
    lineto (x+90) (y+13);
    lineto (x+92) (y+8);
    lineto (x+92) (y+5);
    lineto (x+90) y;
    moveto (x+95) y;
    lineto (x+97) y;
    lineto (x+98) (y+3);
    lineto (x+99) (y+5);
    lineto (x+100) (y+10);
    lineto (x+100) (y+15);
    lineto (x+98) (y+20);
    lineto (x+97) (y+25);
    lineto (x+95) (y+30);
    lineto (x+100) (y+30);;
    clear_graph();
    yg 200 200 100;
    mess 400 130;;
    Au depart j'ai eu la mani de mettre un ; mais Open Graphics mais je me susi rendu compte de l'erreure.

  7. #7
    telodo
    Invité(e)
    Par défaut
    C'est résolus ! En fait j'appelais mal ma fonction graphics ! Voila.

    Merci du temps passe a m'aider tout de meme.

    A bientot

Discussions similaires

  1. [AC-97] Probleme avec un ActiveX mais je ne sais pas lequel
    Par foste dans le forum VBA Access
    Réponses: 5
    Dernier message: 16/07/2013, 15h31
  2. Erreur mais je ne vois pas où
    Par aureliegro dans le forum Langage SQL
    Réponses: 4
    Dernier message: 10/05/2007, 10h28
  3. [Oracle] erreur mais je ne sais pas d'où ça vient
    Par teen6517 dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 27/02/2007, 08h52
  4. pas d'erreur mais update qui marche pas
    Par gloppy dans le forum Requêtes
    Réponses: 2
    Dernier message: 06/12/2006, 15h49
  5. Réponses: 7
    Dernier message: 30/10/2005, 12h54

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