| Auteur |
une erreur introuvable... |
|
|
antoine29 Membre

 Messages: 2 | Message posté: 11-11-2007 à 17:23  
Salutation!
Je me présente avant tout je m'appele antoine
j'ai découvert se sit il y a tout juste 1 mois.
Bon j'ai un probleme de programmation au niveau des Getkeys
voici une partie initiale du programme
ClrText
GridOff
AxesOff
LabelOff
ClrGraph
Text" Hello"
ClrText
"spé math"
ClrText
Lbl 0
ClrText
ClrGraph
BG-None
ViewWindow 1,127,1,1,63,1
Text 5,1,"[1]Þ FACTEURS PREMIERS"
Text 12,1,"[2]Þ NOMBRE PREMIER"
Text 19,1,"[3]Þ PGCD DE deux NOMBRES"
Text 26,1,"[4]Þ DIVISION EUCLIDIENNE"
Text 33,1,"[5]Þ DIVISEURS D'UN NOMBRE"
Text 54,1,"[EXIT]"
Lbl 1
GetkeyÞG
G=72ãGoto 2
G=62ãGoto 3
G=52ãGoto 4
G=73ãGoto H
G=63ãGoto B
G=47ãAxesOn
G=47ãClrText
G=47ãStop
Goto 1
Lbl 2
ClrText
J'y suis depuis pas mal de temps mais j'ai un probleme au niveau des getkey quand je tape 1 ou 2 ... je reste sur l'affichage du menu au lieu de m'amener vers la sous partie désirée, ce qui est assez embétant et désagréable...
je remercie d'avance celui ou celle qui m'aidera...
|
 |
PierrotLL Administrateur

 Messages: 791 Calculatrice : Graph 85 | Message posté: 11-11-2007 à 19:30  
Bonjour, a première vu je ne vois pas de problème dans ton programme.
Ca n'a pas de rapport avec ton problème, mais je te conseil de ne pas utiliser de Goto. Par exemple dans ton cas tu peux faire :While 1  Getkey->G  If G=71  Then...  IfEnd  If G=72  Then...  IfEnd  WhileEnd Ce sera bien plus rapide
 |
 |
antoine29 Membre

 Messages: 2 | Message posté: 12-11-2007 à 16:55  
ok merci un ami a trouvé l'erreur c'été un list qui trainé quelque part,c'été tout bete en réalité...
mais j'ai un nouveau bug...c'est plus difficile de tout regroupé a priori pour l'instant car un truc ma echappé :
ClrText
ClrText
GridOff
AxesOff
LabelOff
ClrGraph
Text" Hello"
ClrText
"spé math"
ClrText
Lbl 0
ClrText
ClrGraph
BG-None
ViewWindow 1,127,1,1,63,1
Text 5,1,"[1]Þ FACTEURS PREMIERS"
Text 12,1,"[2]Þ NOMBRE PREMIER"
Text 19,1,"[3]Þ PGCD DE deux NOMBRES"
Text 26,1,"[4]Þ DIVISION EUCLIDIENNE"
Text 33,1,"[5]Þ DIVISEURS D'UN NOMBRE"
Text 54,1,"[EXIT]"
Lbl 1
GetkeyÞG
G=72ãGoto 2
G=62ãGoto 3
G=52ãGoto 4
G=73ãGoto 5
G=63ãGoto 6
Goto 1
ClrText
Lbl 2
"NOMBRE "?ÞA
A=0ãGoto 0
2ÞB
Do
While Frac (A/B)=0
BÝ
A¹BÞA
WhileEnd
If B=2
Then 3ÞB
Else B‰2ÞB
IfEnd
LpWhile BàA
Goto 0
Lbl 3
ClrText
"NOMBRE "?ÞN
N=1ãGoto 6
N=™1ã"NOMBRE PREMIER"Ý
N=™1ãGoto 0
Int †N‰1ÞO
2ÞA
Lbl 5
Frac (N¹A)ÞP
If P=0
Then If A=N
Then Goto 7
Else Goto 6
IfEnd
IfEnd
Isz A
If A=O
Then Goto 7
IfEnd
Goto 5
Lbl 6
N=1 Or N=0ã"NOMBRE NON PREMIER"Ý
Ná1 And Ná0ã"NOMBRE NON PREMIER CAR DIVISIBLE PAR :"
Ná1 And Ná0ãAÝ
Goto 0
Lbl 7
"NOMBRE PREMIER"Ý
Goto 0
Lbl 4
ClrText
"NOMBRE A "?ÞA
"NOMBRE B "?ÞB
A=0ãStop
B=0ãStop
Lbl 9
Int (A¹B)ÞQ
A™(B©Q)ÞR
If R=0
Then Goto A
IfEnd
BÞA
RÞB
Goto 9Ý
Lbl A
Bá1ãBÝ
If B=1:Then "A ET B SONT PREMIERS ENTRE EUX."Ý
IfEnd
Goto 0
Lbl B
ClrText
"NOMBRE "?ÞN
1ÞA
Lbl C
Frac (N¹A)ÞP
N¹AÞB
If AâB
Then If A=B
Then AÝ
IfEnd
"FIN"Ý
Goto 0
IfEnd
If P=0
Then AÝ
BÝ
IfEnd
Isz A
Goto C
Lbl D
ClrText
"NOMBRE A "?ÞA
"NOMBRE B "?ÞB
If A=0
Then "PAS DE PGCD"Ý
Goto 0
IfEnd
BÞN
Lbl E
N™A©(Int (N¹A))ÞP
If P=0
Then N™B©(Int (N¹B))ÞQ
ClrText
If Q=0
Then NÝ
Goto 0
IfEnd
IfEnd
Isz N
Goto E
Lbl H
0ÞZ
ClrText
"NOMBRE A "?ÞA
"NOMBRE B "?ÞB
ClrText
B=0ãGoto H
If B<0
Then Abs BÞB
1ÞZ
IfEnd
Intg (A¹B)ÞQ
A™(B©Q)ÞR
If Râ0
Then "Q="
If Z=1
Then ‡QÝ
Else QÝ
IfEnd
"R="
RÝ
Else "PAS DE DIVISION EUCLIDIENNE"Ý
IfEnd
Goto 0
on me met syn erreur
merci pour ta reponse PierrotLL
|
 |
PierrotLL Administrateur

 Messages: 791 Calculatrice : Graph 85 | Message posté: 12-11-2007 à 22:27  
Oula, heu, donne nous juste la ligne de l'erreur, ça suffira. Pour la voire, appui sur la flèche gauche ou droite quand il t'affiche Syn Error et donne nous la ligne ou se situe le curseur
 |
 |
dafp Utilisateur Graph

 Messages: 413 Calculatrice : Graph 25+ | Message posté: 13-11-2007 à 19:54  
Moi j'aurais pas eu le courage de tout écrire
 |
 |
PierrotLL Administrateur

 Messages: 791 Calculatrice : Graph 85 | Message posté: 13-11-2007 à 21:59  
Ecrire Ctrl+v c'est pas si dur
 |
 |
rom1dep Administrateur

 Messages: 897 Calculatrice : ClassPad 300+ | Message posté: 13-11-2007 à 22:52  
Ouaip'
Quoi qu'il en soit, ça manque de balise code par ici
 |
 |
Ilae Administrateur

 Messages: 3000 Calculatrice : Graph 65 | Message posté: 14-11-2007 à 17:34  
Il ne faut jamais copier un tel code : personne ne prendra le temps de le lire (à moins d'en avoir beaucoup...)
 |
 |
dafp Utilisateur Graph

 Messages: 413 Calculatrice : Graph 25+ | Message posté: 16-11-2007 à 21:25  
moi j'avou, quand c'est trop long, je lis pas
 |
 |