Bonjour je sais que le go to n'est pas forcément conseiller mais j'aurais besoin d'aide sur son fonctionnement j'ai regarder des tutos mais je cerne pas trop comment ça marche?
Mercii
Bonjour je sais que le go to n'est pas forcément conseiller mais j'aurais besoin d'aide sur son fonctionnement j'ai regarder des tutos mais je cerne pas trop comment ça marche?
Mercii
Salut,
Plus que ça. On va dire qu'on "tolère" ceux qui existe, car c'est pas forcément ce qu'il a de plus simple à refactoriser, mais ça fait partie du pire qu'on puisse faire en mauvaise pratique.
Pour répondre à ta question, un Goto permet d'accéder à une portion de code particulière (tu as des bons exemples sur la doc MSDN dans des boucles, des switch, etc ...).
Si tu nous montre ton code et ce que tu veux faire avec ton Goto, ca sera plus simple pour t'aider.
ha d'accord
En fait , je comptais faire ça ( Grossomodo)
Sauf que j'ai déclarais mes "Reprise" en mode n'importe quoi pour essayer
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 string REQUERY = ""; if (CatégorieRadiologique_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { REQUERY += REQUERY + " AND Radiologique =" + "'" + CatégorieRadiologique_ComboBox_Home.Text + "'"; if (CodeEtatFS_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { Reprise; // Point de reprise du premier GO TO REQUERY += REQUERY + " AND Lib_Code_Etat =" + "'" + CodeEtatFS_ComboBox_Home.Text + "'"; if (Producteur_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { Reprise_2; REQUERY += REQUERY + " AND Producteur =" + "'" + Producteur_ComboBox_Home.Text + "'"; if (Centre_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { Reprise_3; REQUERY += REQUERY + " AND Centre =" + "'" + Centre_ComboBox_Home.Text + "'"; if (StationDestination_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { Reprise_4; REQUERY += REQUERY + " AND Station_Destination =" + "'" + StationDestination_ComboBox_Home.Text + "'"; if (Conditionnement_ComboBox_Home.SelectedIndex != -1) { if (REQUERY != "") { REQUERY += REQUERY + " AND Conditionnement =" + "'" + Conditionnement_ComboBox_Home.Text + "'"; } else { REQUERY += REQUERY + "Conditionnement =" + "'" + Conditionnement_ComboBox_Home.Text + "'"; } } } else { REQUERY += REQUERY + "Station_Destination =" + "'" + StationDestination_ComboBox_Home.Text + "'"; } } } else { REQUERY += REQUERY + "Centre =" + "'" + Centre_ComboBox_Home.Text + "'"; goto Reprise_4; } } } else { REQUERY += REQUERY + "Producteur =" + "'" + Producteur_ComboBox_Home.Text + "'"; goto Reprise_3; } } } else { REQUERY += REQUERY + "Lib_Code_Etat =" + "'" + CodeEtatFS_ComboBox_Home.Text + "'"; goto Reprise_2; } } } else { REQUERY += REQUERY + "Radiologique =" + "'" + CatégorieRadiologique_ComboBox_Home.Text + "'"; goto Reprise; } } else REQUERY += " "; MessageBox.Show(REQUERY);![]()
Bonjour mon cher,
Pourrais tu regarder un peu ceci
merci pour vos réponses. En fait je sais que c'est très très laid ce que j'ai écris mais je cherche à écrire un message en fonction de plusieurs critères qui ne sont pas forcément présents et je cherche toute les solutions possibles qu'elle soit belle ou laide...
Merci pour les explications en tous cas elle m'auront aidées
Partager