pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
If, ca doit le gener, alors je voudrai savoir comment délimité le
line1 par exemple, il est existe un end line1 ???
pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
If, ca doit le gener, alors je voudrai savoir comment délimité le
line1 par exemple, il est existe un end line1 ???
pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
If, ca doit le gener, alors je voudrai savoir comment délimité le
line1 par exemple, il est existe un end line1 ???
Mon code est un peu long mais bon, j'ai du mal a voir comment je
pourrai faire !
----------------
Private Sub cmdChute_Click()
Dim minimachine, lame, arasage, min, max, profiles, reste As
Double Dim LigneAEcrire As String
Dim Ptablo As Integer
Dim POFtablo As Integer
Dim cycle As String
Dim V As Integer
POFtablo = -1
minimachine = 100
lame = 3.7
arasage = 20
min = 400
max = 800
profiles = 6000
line1: Ptablo = 0
cycle = ""
If (Ptablo = UBound(tablo, 1)) Then
If (tablo(Ptablo).longueur <> 0) Then
reste = profiles - arasage - tablo(Ptablo).longueur -
lame Else
' on delimite et on passe à la longueur suivante
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
supprligne (Ptablo)
GoTo line1
End If
line2: If reste < 800 Then
MsgBox ("Attention, les longueurs sont trop grandes")
Else
' On agrandi le tableau OFtablo
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
OFtablo(POFtablo).rep = tablo(Ptablo).rep
OFtablo(POFtablo).mod = tablo(Ptablo).mod
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
OFtablo(POFtablo).qte = tablo(Ptablo).qte
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
OFtablo(POFtablo).cote = tablo(Ptablo).cote
supprligne (Ptablo)
' On soustrait la longueur suivante en verifiant
l'existance de longueur suivante
line3: If (tablo(Ptablo).longueur > 0) Then
reste = reste - tablo(Ptablo).longueur - lame
Else
' ce cycle est terminer en avertissant d'utiliser
les chutes
cycle = "ta"
GoTo line7
End If
'point 1
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800) GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
line5: reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
Ptablo = Ptablo + 1
GoTo line3
Case (reste >= minimachine And reste < min) ' reste > > (minimachine)100 mais < (min)400
' ce cycle est terminé
cycle = "t"
GoTo line6
Case Is < minimachine ' reste < (minimachine)100
reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
reste = reste - lame - minimachine
Do
If (tablo(Ptablo).longueur = 0) Then
GoTo line4
End If
Ptablo = Ptablo + 1
Loop While (tablo(Ptablo).longueur > reste)
line4: If (tablo(Ptablo).longueur = 0) Then
' ce cycle est terminé en avertissant
d'utiliser les chutes
cycle = "ta"
GoTo line7
End If
reste = reste - tablo(Ptablo).longueur +
minimachine
'point 2
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800)
GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
GoTo line5
Case Is < min ' rest < min(400)
' ce cycle est terminé
cycle = "t"
GoTo line6
End Select
' ->ce cycle est terminer
line6: If (cycle = "t") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
line7: If (cycle = "ta") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose probleme !!!
Else
lblFichier.Text = ""
For V = 0 To Ubount(OFtablo, 1)
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).dossier
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
"|" & OFtablo(POFtablo).mod lblFichier.Text > lblFichier & "|" &
OFtablo(POFtablo).teinte
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).longueur
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).gauche
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).cote & vbCrLf
Next V
End If
End Sub
------------------------------------
Si qqun trouve pk , ca serai cool :)
Merci !
"Jean-Michel" a écrit dans le
message news: #Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le
bloc If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit
le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
End If, ca doit le gener, alors je voudrai savoir comment délimité
le line1 par exemple, il est existe un end line1 ???
Merci !
Mon code est un peu long mais bon, j'ai du mal a voir comment je
pourrai faire !
----------------
Private Sub cmdChute_Click()
Dim minimachine, lame, arasage, min, max, profiles, reste As
Double Dim LigneAEcrire As String
Dim Ptablo As Integer
Dim POFtablo As Integer
Dim cycle As String
Dim V As Integer
POFtablo = -1
minimachine = 100
lame = 3.7
arasage = 20
min = 400
max = 800
profiles = 6000
line1: Ptablo = 0
cycle = ""
If (Ptablo = UBound(tablo, 1)) Then
If (tablo(Ptablo).longueur <> 0) Then
reste = profiles - arasage - tablo(Ptablo).longueur -
lame Else
' on delimite et on passe à la longueur suivante
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
supprligne (Ptablo)
GoTo line1
End If
line2: If reste < 800 Then
MsgBox ("Attention, les longueurs sont trop grandes")
Else
' On agrandi le tableau OFtablo
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
OFtablo(POFtablo).rep = tablo(Ptablo).rep
OFtablo(POFtablo).mod = tablo(Ptablo).mod
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
OFtablo(POFtablo).qte = tablo(Ptablo).qte
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
OFtablo(POFtablo).cote = tablo(Ptablo).cote
supprligne (Ptablo)
' On soustrait la longueur suivante en verifiant
l'existance de longueur suivante
line3: If (tablo(Ptablo).longueur > 0) Then
reste = reste - tablo(Ptablo).longueur - lame
Else
' ce cycle est terminer en avertissant d'utiliser
les chutes
cycle = "ta"
GoTo line7
End If
'point 1
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800) GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
line5: reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
Ptablo = Ptablo + 1
GoTo line3
Case (reste >= minimachine And reste < min) ' reste > > (minimachine)100 mais < (min)400
' ce cycle est terminé
cycle = "t"
GoTo line6
Case Is < minimachine ' reste < (minimachine)100
reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
reste = reste - lame - minimachine
Do
If (tablo(Ptablo).longueur = 0) Then
GoTo line4
End If
Ptablo = Ptablo + 1
Loop While (tablo(Ptablo).longueur > reste)
line4: If (tablo(Ptablo).longueur = 0) Then
' ce cycle est terminé en avertissant
d'utiliser les chutes
cycle = "ta"
GoTo line7
End If
reste = reste - tablo(Ptablo).longueur +
minimachine
'point 2
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800)
GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
GoTo line5
Case Is < min ' rest < min(400)
' ce cycle est terminé
cycle = "t"
GoTo line6
End Select
' ->ce cycle est terminer
line6: If (cycle = "t") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
line7: If (cycle = "ta") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose probleme !!!
Else
lblFichier.Text = ""
For V = 0 To Ubount(OFtablo, 1)
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).dossier
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
"|" & OFtablo(POFtablo).mod lblFichier.Text > lblFichier & "|" &
OFtablo(POFtablo).teinte
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).longueur
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).gauche
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).cote & vbCrLf
Next V
End If
End Sub
------------------------------------
Si qqun trouve pk , ca serai cool :)
Merci !
"Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
message news: #9rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl...
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le
bloc If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit
le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
End If, ca doit le gener, alors je voudrai savoir comment délimité
le line1 par exemple, il est existe un end line1 ???
Merci !
Mon code est un peu long mais bon, j'ai du mal a voir comment je
pourrai faire !
----------------
Private Sub cmdChute_Click()
Dim minimachine, lame, arasage, min, max, profiles, reste As
Double Dim LigneAEcrire As String
Dim Ptablo As Integer
Dim POFtablo As Integer
Dim cycle As String
Dim V As Integer
POFtablo = -1
minimachine = 100
lame = 3.7
arasage = 20
min = 400
max = 800
profiles = 6000
line1: Ptablo = 0
cycle = ""
If (Ptablo = UBound(tablo, 1)) Then
If (tablo(Ptablo).longueur <> 0) Then
reste = profiles - arasage - tablo(Ptablo).longueur -
lame Else
' on delimite et on passe à la longueur suivante
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
supprligne (Ptablo)
GoTo line1
End If
line2: If reste < 800 Then
MsgBox ("Attention, les longueurs sont trop grandes")
Else
' On agrandi le tableau OFtablo
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
OFtablo(POFtablo).rep = tablo(Ptablo).rep
OFtablo(POFtablo).mod = tablo(Ptablo).mod
OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
OFtablo(POFtablo).qte = tablo(Ptablo).qte
OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
OFtablo(POFtablo).cote = tablo(Ptablo).cote
supprligne (Ptablo)
' On soustrait la longueur suivante en verifiant
l'existance de longueur suivante
line3: If (tablo(Ptablo).longueur > 0) Then
reste = reste - tablo(Ptablo).longueur - lame
Else
' ce cycle est terminer en avertissant d'utiliser
les chutes
cycle = "ta"
GoTo line7
End If
'point 1
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800) GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
line5: reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
Ptablo = Ptablo + 1
GoTo line3
Case (reste >= minimachine And reste < min) ' reste > > (minimachine)100 mais < (min)400
' ce cycle est terminé
cycle = "t"
GoTo line6
Case Is < minimachine ' reste < (minimachine)100
reste = reste + tablo(Ptablo).longueur + lame ' on
annule la derniere longueur
reste = reste - lame - minimachine
Do
If (tablo(Ptablo).longueur = 0) Then
GoTo line4
End If
Ptablo = Ptablo + 1
Loop While (tablo(Ptablo).longueur > reste)
line4: If (tablo(Ptablo).longueur = 0) Then
' ce cycle est terminé en avertissant
d'utiliser les chutes
cycle = "ta"
GoTo line7
End If
reste = reste - tablo(Ptablo).longueur +
minimachine
'point 2
Select Case reste
Case Is >= max ' reste est plus grand ou egale à
max(800)
GoTo line2
Case (reste >= min And reste < max) ' reste > > min(400) mais < max(800)
GoTo line5
Case Is < min ' rest < min(400)
' ce cycle est terminé
cycle = "t"
GoTo line6
End Select
' ->ce cycle est terminer
line6: If (cycle = "t") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
line7: If (cycle = "ta") Then
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
' On retient pour l'OF
OFtablo(POFtablo).ref = tablo(Ptablo).ref
OFtablo(POFtablo).dossier > tablo(Ptablo).dossier OFtablo(POFtablo).rep > tablo(Ptablo).rep OFtablo(POFtablo).mod > tablo(Ptablo).mod OFtablo(POFtablo).teinte > tablo(Ptablo).teinte OFtablo(POFtablo).qte > tablo(Ptablo).qte OFtablo(POFtablo).longueur
= tablo(Ptablo).longueur
OFtablo(POFtablo).gauche > tablo(Ptablo).gauche OFtablo(POFtablo).cote > tablo(Ptablo).cote supprligne (Ptablo)
' On agrandi le tableau
POFtablo = POFtablo + 1
ReDim Preserve OFtablo(POFtablo)
OFtablo(POFtablo).ref = "-"
OFtablo(POFtablo).dossier = "-"
OFtablo(POFtablo).rep = "-"
OFtablo(POFtablo).mod = "-"
OFtablo(POFtablo).teinte = "-"
OFtablo(POFtablo).qte = "0"
OFtablo(POFtablo).longueur = "0"
OFtablo(POFtablo).gauche = "-"
OFtablo(POFtablo).cote = "-"
GoTo line1
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose probleme !!!
Else
lblFichier.Text = ""
For V = 0 To Ubount(OFtablo, 1)
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).dossier
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
"|" & OFtablo(POFtablo).mod lblFichier.Text > lblFichier & "|" &
OFtablo(POFtablo).teinte
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
"|" &
OFtablo(POFtablo).longueur
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).gauche
lblFichier.Text = lblFichier & "|" &
OFtablo(POFtablo).cote & vbCrLf
Next V
End If
End Sub
------------------------------------
Si qqun trouve pk , ca serai cool :)
Merci !
"Jean-Michel" a écrit dans le
message news: #Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
line 2: Du coup, ca me met plein d'erreur du type End If sans le
bloc If, alors que j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit
le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
End If, ca doit le gener, alors je voudrai savoir comment délimité
le line1 par exemple, il est existe un end line1 ???
Merci !
"Jean-Michel" a écrit dans le
message de news:%
> pour mon programme, j'utilise des goto vers des line1 : ou
> line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
> If, alors que j'ai bien le bon nombre!
> Je crois que ca doit venir que du fait que quand le programme suit le
> goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
> If, ca doit le gener, alors je voudrai savoir comment délimité le
> line1 par exemple, il est existe un end line1 ???
Bonjour/soir,
Le code suivant ne pose aucun problème:
Dim Toto As Long
Toto = 10
If Toto = 10 Then GoTo OtherIf
If Toto Then
Toto = -15
OtherIf:
MsgBox Toto
End If
Par contre, le goto est souvent source d'ennuis pour la relecture du code.
<quote src=msdn>
Note Too many GoTo statements can make code difficult to read and debug.
Use structured control statements (Do...Loop, For...Next,
Select Case) whenever possible.
</quote>
Si tu propose toi même de délimiter les morceau où tu vas employer goto,
utilise alors des méthodes et des fonctions!
Si il est impossible de faire autrement, poste le bout de code qui pose
problème et on tentera de trouver le problème!
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
"Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
message de news:%239rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl
> pour mon programme, j'utilise des goto vers des line1 : ou
> line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
> If, alors que j'ai bien le bon nombre!
> Je crois que ca doit venir que du fait que quand le programme suit le
> goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
> If, ca doit le gener, alors je voudrai savoir comment délimité le
> line1 par exemple, il est existe un end line1 ???
Bonjour/soir,
Le code suivant ne pose aucun problème:
Dim Toto As Long
Toto = 10
If Toto = 10 Then GoTo OtherIf
If Toto Then
Toto = -15
OtherIf:
MsgBox Toto
End If
Par contre, le goto est souvent source d'ennuis pour la relecture du code.
<quote src=msdn>
Note Too many GoTo statements can make code difficult to read and debug.
Use structured control statements (Do...Loop, For...Next,
Select Case) whenever possible.
</quote>
Si tu propose toi même de délimiter les morceau où tu vas employer goto,
utilise alors des méthodes et des fonctions!
Si il est impossible de faire autrement, poste le bout de code qui pose
problème et on tentera de trouver le problème!
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
"Jean-Michel" a écrit dans le
message de news:%
> pour mon programme, j'utilise des goto vers des line1 : ou
> line 2: Du coup, ca me met plein d'erreur du type End If sans le bloc
> If, alors que j'ai bien le bon nombre!
> Je crois que ca doit venir que du fait que quand le programme suit le
> goto, et que je lui fait rentrer dans un bloc, et qu'il troude End
> If, ca doit le gener, alors je voudrai savoir comment délimité le
> line1 par exemple, il est existe un end line1 ???
Bonjour/soir,
Le code suivant ne pose aucun problème:
Dim Toto As Long
Toto = 10
If Toto = 10 Then GoTo OtherIf
If Toto Then
Toto = -15
OtherIf:
MsgBox Toto
End If
Par contre, le goto est souvent source d'ennuis pour la relecture du code.
<quote src=msdn>
Note Too many GoTo statements can make code difficult to read and debug.
Use structured control statements (Do...Loop, For...Next,
Select Case) whenever possible.
</quote>
Si tu propose toi même de délimiter les morceau où tu vas employer goto,
utilise alors des méthodes et des fonctions!
Si il est impossible de faire autrement, poste le bout de code qui pose
problème et on tentera de trouver le problème!
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
"Jean-Michel" a écrit dans le
message de news:%
> Mon code est un peu long mais bon, j'ai du mal a voir comment je
> pourrai faire !
> ----------------
>
> Private Sub cmdChute_Click()
> Dim minimachine, lame, arasage, min, max, profiles, reste As
> Double Dim LigneAEcrire As String
> Dim Ptablo As Integer
> Dim POFtablo As Integer
> Dim cycle As String
> Dim V As Integer
> POFtablo = -1
>
> minimachine = 100
> lame = 3.7
> arasage = 20
> min = 400
> max = 800
> profiles = 6000
>
> line1: Ptablo = 0
> cycle = ""
> If (Ptablo = UBound(tablo, 1)) Then
> If (tablo(Ptablo).longueur <> 0) Then
> reste = profiles - arasage - tablo(Ptablo).longueur -
> lame Else
> ' on delimite et on passe à la longueur suivante
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
> OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> supprligne (Ptablo)
> GoTo line1
> End If
>
> line2: If reste < 800 Then
> MsgBox ("Attention, les longueurs sont trop grandes")
> Else
> ' On agrandi le tableau OFtablo
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> OFtablo(POFtablo).rep = tablo(Ptablo).rep
> OFtablo(POFtablo).mod = tablo(Ptablo).mod
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> OFtablo(POFtablo).qte = tablo(Ptablo).qte
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> OFtablo(POFtablo).cote = tablo(Ptablo).cote
> supprligne (Ptablo)
>
> ' On soustrait la longueur suivante en verifiant
> l'existance de longueur suivante
> line3: If (tablo(Ptablo).longueur > 0) Then
> reste = reste - tablo(Ptablo).longueur - lame
> Else
> ' ce cycle est terminer en avertissant d'utiliser
> les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> 'point 1
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800) GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> Ptablo = Ptablo + 1
> GoTo line3
> Case (reste >= minimachine And reste < min) ' reste > > > (minimachine)100 mais < (min)400
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> Case Is < minimachine ' reste < (minimachine)100
> reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> reste = reste - lame - minimachine
> Do
> If (tablo(Ptablo).longueur = 0) Then
> GoTo line4
> End If
> Ptablo = Ptablo + 1
> Loop While (tablo(Ptablo).longueur > reste)
>
> line4: If (tablo(Ptablo).longueur = 0) Then
> ' ce cycle est terminé en avertissant
> d'utiliser les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> reste = reste - tablo(Ptablo).longueur +
> minimachine
>
> 'point 2
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800)
> GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> GoTo line5
> Case Is < min ' rest < min(400)
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> End Select
>
> ' ->ce cycle est terminer
> line6: If (cycle = "t") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> line7: If (cycle = "ta") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose probleme !!!
> Else
> lblFichier.Text = ""
> For V = 0 To Ubount(OFtablo, 1)
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).dossier
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> "|" & OFtablo(POFtablo).mod lblFichier.Text > > lblFichier & "|" &
> OFtablo(POFtablo).teinte
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).longueur
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).gauche
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).cote & vbCrLf
> Next V
> End If
> End Sub
>
> ------------------------------------
>
> Si qqun trouve pk , ca serai cool :)
> Merci !
>
>
> "Jean-Michel" a écrit dans le
> message news: #
>> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
>> line 2: Du coup, ca me met plein d'erreur du type End If sans le
>> bloc If, alors que j'ai bien le bon nombre!
>> Je crois que ca doit venir que du fait que quand le programme suit
>> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
>> End If, ca doit le gener, alors je voudrai savoir comment délimité
>> le line1 par exemple, il est existe un end line1 ???
>>
>> Merci !
Bonjour/soir,
En réindentant un peu ton code, voici ce que je lis:
If (Ptablo = UBound(tablo, 1)) Then
'point 1
Select Case reste
Case Is < minimachine
line7: If (cycle = "ta") Then
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
probleme !!!
Else
...
On a au même niveau Select Case et End If
Peut-être qu'un End Select serait plus approprié?
Il faudrait (mais je ne comprend pas bien ce code) faire diverse fonctions
et sub pour les tâches répétées, remplacer les goto en série par des
ou autre et ce serait alors, AMHA, plus lisible et ça éviterais (toujours
AMHA) ce genre d'erreurs.
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
"Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
message de news:%23j2uEHSqDHA.1632@TK2MSFTNGP10.phx.gbl
> Mon code est un peu long mais bon, j'ai du mal a voir comment je
> pourrai faire !
> ----------------
>
> Private Sub cmdChute_Click()
> Dim minimachine, lame, arasage, min, max, profiles, reste As
> Double Dim LigneAEcrire As String
> Dim Ptablo As Integer
> Dim POFtablo As Integer
> Dim cycle As String
> Dim V As Integer
> POFtablo = -1
>
> minimachine = 100
> lame = 3.7
> arasage = 20
> min = 400
> max = 800
> profiles = 6000
>
> line1: Ptablo = 0
> cycle = ""
> If (Ptablo = UBound(tablo, 1)) Then
> If (tablo(Ptablo).longueur <> 0) Then
> reste = profiles - arasage - tablo(Ptablo).longueur -
> lame Else
> ' on delimite et on passe à la longueur suivante
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
> OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> supprligne (Ptablo)
> GoTo line1
> End If
>
> line2: If reste < 800 Then
> MsgBox ("Attention, les longueurs sont trop grandes")
> Else
> ' On agrandi le tableau OFtablo
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> OFtablo(POFtablo).rep = tablo(Ptablo).rep
> OFtablo(POFtablo).mod = tablo(Ptablo).mod
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> OFtablo(POFtablo).qte = tablo(Ptablo).qte
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> OFtablo(POFtablo).cote = tablo(Ptablo).cote
> supprligne (Ptablo)
>
> ' On soustrait la longueur suivante en verifiant
> l'existance de longueur suivante
> line3: If (tablo(Ptablo).longueur > 0) Then
> reste = reste - tablo(Ptablo).longueur - lame
> Else
> ' ce cycle est terminer en avertissant d'utiliser
> les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> 'point 1
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800) GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> Ptablo = Ptablo + 1
> GoTo line3
> Case (reste >= minimachine And reste < min) ' reste > > > (minimachine)100 mais < (min)400
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> Case Is < minimachine ' reste < (minimachine)100
> reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> reste = reste - lame - minimachine
> Do
> If (tablo(Ptablo).longueur = 0) Then
> GoTo line4
> End If
> Ptablo = Ptablo + 1
> Loop While (tablo(Ptablo).longueur > reste)
>
> line4: If (tablo(Ptablo).longueur = 0) Then
> ' ce cycle est terminé en avertissant
> d'utiliser les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> reste = reste - tablo(Ptablo).longueur +
> minimachine
>
> 'point 2
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800)
> GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> GoTo line5
> Case Is < min ' rest < min(400)
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> End Select
>
> ' ->ce cycle est terminer
> line6: If (cycle = "t") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> line7: If (cycle = "ta") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose probleme !!!
> Else
> lblFichier.Text = ""
> For V = 0 To Ubount(OFtablo, 1)
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).dossier
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> "|" & OFtablo(POFtablo).mod lblFichier.Text > > lblFichier & "|" &
> OFtablo(POFtablo).teinte
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).longueur
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).gauche
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).cote & vbCrLf
> Next V
> End If
> End Sub
>
> ------------------------------------
>
> Si qqun trouve pk , ca serai cool :)
> Merci !
>
>
> "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
> message news: #9rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl...
>> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
>> line 2: Du coup, ca me met plein d'erreur du type End If sans le
>> bloc If, alors que j'ai bien le bon nombre!
>> Je crois que ca doit venir que du fait que quand le programme suit
>> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
>> End If, ca doit le gener, alors je voudrai savoir comment délimité
>> le line1 par exemple, il est existe un end line1 ???
>>
>> Merci !
Bonjour/soir,
En réindentant un peu ton code, voici ce que je lis:
If (Ptablo = UBound(tablo, 1)) Then
'point 1
Select Case reste
Case Is < minimachine
line7: If (cycle = "ta") Then
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
probleme !!!
Else
...
On a au même niveau Select Case et End If
Peut-être qu'un End Select serait plus approprié?
Il faudrait (mais je ne comprend pas bien ce code) faire diverse fonctions
et sub pour les tâches répétées, remplacer les goto en série par des
ou autre et ce serait alors, AMHA, plus lisible et ça éviterais (toujours
AMHA) ce genre d'erreurs.
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
"Jean-Michel" a écrit dans le
message de news:%
> Mon code est un peu long mais bon, j'ai du mal a voir comment je
> pourrai faire !
> ----------------
>
> Private Sub cmdChute_Click()
> Dim minimachine, lame, arasage, min, max, profiles, reste As
> Double Dim LigneAEcrire As String
> Dim Ptablo As Integer
> Dim POFtablo As Integer
> Dim cycle As String
> Dim V As Integer
> POFtablo = -1
>
> minimachine = 100
> lame = 3.7
> arasage = 20
> min = 400
> max = 800
> profiles = 6000
>
> line1: Ptablo = 0
> cycle = ""
> If (Ptablo = UBound(tablo, 1)) Then
> If (tablo(Ptablo).longueur <> 0) Then
> reste = profiles - arasage - tablo(Ptablo).longueur -
> lame Else
> ' on delimite et on passe à la longueur suivante
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
> OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> supprligne (Ptablo)
> GoTo line1
> End If
>
> line2: If reste < 800 Then
> MsgBox ("Attention, les longueurs sont trop grandes")
> Else
> ' On agrandi le tableau OFtablo
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> OFtablo(POFtablo).rep = tablo(Ptablo).rep
> OFtablo(POFtablo).mod = tablo(Ptablo).mod
> OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> OFtablo(POFtablo).qte = tablo(Ptablo).qte
> OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> OFtablo(POFtablo).cote = tablo(Ptablo).cote
> supprligne (Ptablo)
>
> ' On soustrait la longueur suivante en verifiant
> l'existance de longueur suivante
> line3: If (tablo(Ptablo).longueur > 0) Then
> reste = reste - tablo(Ptablo).longueur - lame
> Else
> ' ce cycle est terminer en avertissant d'utiliser
> les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> 'point 1
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800) GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> Ptablo = Ptablo + 1
> GoTo line3
> Case (reste >= minimachine And reste < min) ' reste > > > (minimachine)100 mais < (min)400
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> Case Is < minimachine ' reste < (minimachine)100
> reste = reste + tablo(Ptablo).longueur + lame ' on
> annule la derniere longueur
> reste = reste - lame - minimachine
> Do
> If (tablo(Ptablo).longueur = 0) Then
> GoTo line4
> End If
> Ptablo = Ptablo + 1
> Loop While (tablo(Ptablo).longueur > reste)
>
> line4: If (tablo(Ptablo).longueur = 0) Then
> ' ce cycle est terminé en avertissant
> d'utiliser les chutes
> cycle = "ta"
> GoTo line7
> End If
>
> reste = reste - tablo(Ptablo).longueur +
> minimachine
>
> 'point 2
> Select Case reste
> Case Is >= max ' reste est plus grand ou egale à
> max(800)
> GoTo line2
> Case (reste >= min And reste < max) ' reste > > > min(400) mais < max(800)
> GoTo line5
> Case Is < min ' rest < min(400)
> ' ce cycle est terminé
> cycle = "t"
> GoTo line6
> End Select
>
> ' ->ce cycle est terminer
> line6: If (cycle = "t") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> line7: If (cycle = "ta") Then
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> ' On retient pour l'OF
> OFtablo(POFtablo).ref = tablo(Ptablo).ref
> OFtablo(POFtablo).dossier > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> = tablo(Ptablo).longueur
> OFtablo(POFtablo).gauche > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > tablo(Ptablo).cote supprligne (Ptablo)
>
> ' On agrandi le tableau
> POFtablo = POFtablo + 1
> ReDim Preserve OFtablo(POFtablo)
>
> OFtablo(POFtablo).ref = "-"
> OFtablo(POFtablo).dossier = "-"
> OFtablo(POFtablo).rep = "-"
> OFtablo(POFtablo).mod = "-"
> OFtablo(POFtablo).teinte = "-"
> OFtablo(POFtablo).qte = "0"
> OFtablo(POFtablo).longueur = "0"
> OFtablo(POFtablo).gauche = "-"
> OFtablo(POFtablo).cote = "-"
> GoTo line1
>
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose probleme !!!
> Else
> lblFichier.Text = ""
> For V = 0 To Ubount(OFtablo, 1)
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).dossier
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> "|" & OFtablo(POFtablo).mod lblFichier.Text > > lblFichier & "|" &
> OFtablo(POFtablo).teinte
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> "|" &
> OFtablo(POFtablo).longueur
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).gauche
> lblFichier.Text = lblFichier & "|" &
> OFtablo(POFtablo).cote & vbCrLf
> Next V
> End If
> End Sub
>
> ------------------------------------
>
> Si qqun trouve pk , ca serai cool :)
> Merci !
>
>
> "Jean-Michel" a écrit dans le
> message news: #
>> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
>> line 2: Du coup, ca me met plein d'erreur du type End If sans le
>> bloc If, alors que j'ai bien le bon nombre!
>> Je crois que ca doit venir que du fait que quand le programme suit
>> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
>> End If, ca doit le gener, alors je voudrai savoir comment délimité
>> le line1 par exemple, il est existe un end line1 ???
>>
>> Merci !
Bonjour/soir,
En réindentant un peu ton code, voici ce que je lis:
If (Ptablo = UBound(tablo, 1)) Then
'point 1
Select Case reste
Case Is < minimachine
line7: If (cycle = "ta") Then
End If
End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
probleme !!!
Else
...
On a au même niveau Select Case et End If
Peut-être qu'un End Select serait plus approprié?
Il faudrait (mais je ne comprend pas bien ce code) faire diverse fonctions
et sub pour les tâches répétées, remplacer les goto en série par des
ou autre et ce serait alors, AMHA, plus lisible et ça éviterais (toujours
AMHA) ce genre d'erreurs.
--
François Picalausa (MVP VB)
FAQ VB : http://faq.vb.free.fr
MSDN : http://msdn.microsoft.com
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Ca a l'air de se debloquer, merci !
"François Picalausa" a écrit dans le message news:
> "Jean-Michel" a écrit dans le
> message de news:%
> > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > pourrai faire !
> > ----------------
> >
> > Private Sub cmdChute_Click()
> > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > Double Dim LigneAEcrire As String
> > Dim Ptablo As Integer
> > Dim POFtablo As Integer
> > Dim cycle As String
> > Dim V As Integer
> > POFtablo = -1
> >
> > minimachine = 100
> > lame = 3.7
> > arasage = 20
> > min = 400
> > max = 800
> > profiles = 6000
> >
> > line1: Ptablo = 0
> > cycle = ""
> > If (Ptablo = UBound(tablo, 1)) Then
> > If (tablo(Ptablo).longueur <> 0) Then
> > reste = profiles - arasage - tablo(Ptablo).longueur -
> > lame Else
> > ' on delimite et on passe à la longueur suivante
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > supprligne (Ptablo)
> > GoTo line1
> > End If
> >
> > line2: If reste < 800 Then
> > MsgBox ("Attention, les longueurs sont trop grandes")
> > Else
> > ' On agrandi le tableau OFtablo
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > supprligne (Ptablo)
> >
> > ' On soustrait la longueur suivante en verifiant
> > l'existance de longueur suivante
> > line3: If (tablo(Ptablo).longueur > 0) Then
> > reste = reste - tablo(Ptablo).longueur - lame
> > Else
> > ' ce cycle est terminer en avertissant d'utiliser
> > les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > 'point 1
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800) GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > Ptablo = Ptablo + 1
> > GoTo line3
> > Case (reste >= minimachine And reste < min) ' reste > > > > (minimachine)100 mais < (min)400
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > Case Is < minimachine ' reste < (minimachine)100
> > reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > reste = reste - lame - minimachine
> > Do
> > If (tablo(Ptablo).longueur = 0) Then
> > GoTo line4
> > End If
> > Ptablo = Ptablo + 1
> > Loop While (tablo(Ptablo).longueur > reste)
> >
> > line4: If (tablo(Ptablo).longueur = 0) Then
> > ' ce cycle est terminé en avertissant
> > d'utiliser les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > reste = reste - tablo(Ptablo).longueur +
> > minimachine
> >
> > 'point 2
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800)
> > GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > GoTo line5
> > Case Is < min ' rest < min(400)
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > End Select
> >
> > ' ->ce cycle est terminer
> > line6: If (cycle = "t") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > line7: If (cycle = "ta") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > pose probleme !!!
> > Else
> > lblFichier.Text = ""
> > For V = 0 To Ubount(OFtablo, 1)
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).dossier
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > lblFichier & "|" &
> > OFtablo(POFtablo).teinte
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).longueur
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).gauche
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).cote & vbCrLf
> > Next V
> > End If
> > End Sub
> >
> > ------------------------------------
> >
> > Si qqun trouve pk , ca serai cool :)
> > Merci !
> >
> >
> > "Jean-Michel" a écrit dans le
> > message news: #
> >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> >> bloc If, alors que j'ai bien le bon nombre!
> >> Je crois que ca doit venir que du fait que quand le programme suit
> >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> >> le line1 par exemple, il est existe un end line1 ???
> >>
> >> Merci !
>
> Bonjour/soir,
>
> En réindentant un peu ton code, voici ce que je lis:
>
> If (Ptablo = UBound(tablo, 1)) Then
> 'point 1
> Select Case reste
> Case Is < minimachine
> line7: If (cycle = "ta") Then
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose
> probleme !!!
> Else
> ...
> On a au même niveau Select Case et End If
> Peut-être qu'un End Select serait plus approprié?
>
> Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> et sub pour les tâches répétées, remplacer les goto en série par des
do/loop
> ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> AMHA) ce genre d'erreurs.
>
> --
> François Picalausa (MVP VB)
> FAQ VB : http://faq.vb.free.fr
> MSDN : http://msdn.microsoft.com
>
>
Ca a l'air de se debloquer, merci !
"François Picalausa" <fpicalausa@chez.com> a écrit dans le message news:
OaqH5NSqDHA.3732@tk2msftngp13.phx.gbl...
> "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
> message de news:%23j2uEHSqDHA.1632@TK2MSFTNGP10.phx.gbl
> > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > pourrai faire !
> > ----------------
> >
> > Private Sub cmdChute_Click()
> > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > Double Dim LigneAEcrire As String
> > Dim Ptablo As Integer
> > Dim POFtablo As Integer
> > Dim cycle As String
> > Dim V As Integer
> > POFtablo = -1
> >
> > minimachine = 100
> > lame = 3.7
> > arasage = 20
> > min = 400
> > max = 800
> > profiles = 6000
> >
> > line1: Ptablo = 0
> > cycle = ""
> > If (Ptablo = UBound(tablo, 1)) Then
> > If (tablo(Ptablo).longueur <> 0) Then
> > reste = profiles - arasage - tablo(Ptablo).longueur -
> > lame Else
> > ' on delimite et on passe à la longueur suivante
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > supprligne (Ptablo)
> > GoTo line1
> > End If
> >
> > line2: If reste < 800 Then
> > MsgBox ("Attention, les longueurs sont trop grandes")
> > Else
> > ' On agrandi le tableau OFtablo
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > supprligne (Ptablo)
> >
> > ' On soustrait la longueur suivante en verifiant
> > l'existance de longueur suivante
> > line3: If (tablo(Ptablo).longueur > 0) Then
> > reste = reste - tablo(Ptablo).longueur - lame
> > Else
> > ' ce cycle est terminer en avertissant d'utiliser
> > les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > 'point 1
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800) GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > Ptablo = Ptablo + 1
> > GoTo line3
> > Case (reste >= minimachine And reste < min) ' reste > > > > (minimachine)100 mais < (min)400
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > Case Is < minimachine ' reste < (minimachine)100
> > reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > reste = reste - lame - minimachine
> > Do
> > If (tablo(Ptablo).longueur = 0) Then
> > GoTo line4
> > End If
> > Ptablo = Ptablo + 1
> > Loop While (tablo(Ptablo).longueur > reste)
> >
> > line4: If (tablo(Ptablo).longueur = 0) Then
> > ' ce cycle est terminé en avertissant
> > d'utiliser les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > reste = reste - tablo(Ptablo).longueur +
> > minimachine
> >
> > 'point 2
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800)
> > GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > GoTo line5
> > Case Is < min ' rest < min(400)
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > End Select
> >
> > ' ->ce cycle est terminer
> > line6: If (cycle = "t") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > line7: If (cycle = "ta") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > pose probleme !!!
> > Else
> > lblFichier.Text = ""
> > For V = 0 To Ubount(OFtablo, 1)
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).dossier
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > lblFichier & "|" &
> > OFtablo(POFtablo).teinte
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).longueur
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).gauche
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).cote & vbCrLf
> > Next V
> > End If
> > End Sub
> >
> > ------------------------------------
> >
> > Si qqun trouve pk , ca serai cool :)
> > Merci !
> >
> >
> > "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
> > message news: #9rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl...
> >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> >> bloc If, alors que j'ai bien le bon nombre!
> >> Je crois que ca doit venir que du fait que quand le programme suit
> >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> >> le line1 par exemple, il est existe un end line1 ???
> >>
> >> Merci !
>
> Bonjour/soir,
>
> En réindentant un peu ton code, voici ce que je lis:
>
> If (Ptablo = UBound(tablo, 1)) Then
> 'point 1
> Select Case reste
> Case Is < minimachine
> line7: If (cycle = "ta") Then
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose
> probleme !!!
> Else
> ...
> On a au même niveau Select Case et End If
> Peut-être qu'un End Select serait plus approprié?
>
> Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> et sub pour les tâches répétées, remplacer les goto en série par des
do/loop
> ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> AMHA) ce genre d'erreurs.
>
> --
> François Picalausa (MVP VB)
> FAQ VB : http://faq.vb.free.fr
> MSDN : http://msdn.microsoft.com
>
>
Ca a l'air de se debloquer, merci !
"François Picalausa" a écrit dans le message news:
> "Jean-Michel" a écrit dans le
> message de news:%
> > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > pourrai faire !
> > ----------------
> >
> > Private Sub cmdChute_Click()
> > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > Double Dim LigneAEcrire As String
> > Dim Ptablo As Integer
> > Dim POFtablo As Integer
> > Dim cycle As String
> > Dim V As Integer
> > POFtablo = -1
> >
> > minimachine = 100
> > lame = 3.7
> > arasage = 20
> > min = 400
> > max = 800
> > profiles = 6000
> >
> > line1: Ptablo = 0
> > cycle = ""
> > If (Ptablo = UBound(tablo, 1)) Then
> > If (tablo(Ptablo).longueur <> 0) Then
> > reste = profiles - arasage - tablo(Ptablo).longueur -
> > lame Else
> > ' on delimite et on passe à la longueur suivante
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier ' -
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur '
> > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche ' -
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > supprligne (Ptablo)
> > GoTo line1
> > End If
> >
> > line2: If reste < 800 Then
> > MsgBox ("Attention, les longueurs sont trop grandes")
> > Else
> > ' On agrandi le tableau OFtablo
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > supprligne (Ptablo)
> >
> > ' On soustrait la longueur suivante en verifiant
> > l'existance de longueur suivante
> > line3: If (tablo(Ptablo).longueur > 0) Then
> > reste = reste - tablo(Ptablo).longueur - lame
> > Else
> > ' ce cycle est terminer en avertissant d'utiliser
> > les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > 'point 1
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800) GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > line5: reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > Ptablo = Ptablo + 1
> > GoTo line3
> > Case (reste >= minimachine And reste < min) ' reste > > > > (minimachine)100 mais < (min)400
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > Case Is < minimachine ' reste < (minimachine)100
> > reste = reste + tablo(Ptablo).longueur + lame ' on
> > annule la derniere longueur
> > reste = reste - lame - minimachine
> > Do
> > If (tablo(Ptablo).longueur = 0) Then
> > GoTo line4
> > End If
> > Ptablo = Ptablo + 1
> > Loop While (tablo(Ptablo).longueur > reste)
> >
> > line4: If (tablo(Ptablo).longueur = 0) Then
> > ' ce cycle est terminé en avertissant
> > d'utiliser les chutes
> > cycle = "ta"
> > GoTo line7
> > End If
> >
> > reste = reste - tablo(Ptablo).longueur +
> > minimachine
> >
> > 'point 2
> > Select Case reste
> > Case Is >= max ' reste est plus grand ou egale à
> > max(800)
> > GoTo line2
> > Case (reste >= min And reste < max) ' reste > > > > min(400) mais < max(800)
> > GoTo line5
> > Case Is < min ' rest < min(400)
> > ' ce cycle est terminé
> > cycle = "t"
> > GoTo line6
> > End Select
> >
> > ' ->ce cycle est terminer
> > line6: If (cycle = "t") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > line7: If (cycle = "ta") Then
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > ' On retient pour l'OF
> > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > OFtablo(POFtablo).dossier > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte > > > tablo(Ptablo).teinte OFtablo(POFtablo).qte > > > tablo(Ptablo).qte OFtablo(POFtablo).longueur
> > = tablo(Ptablo).longueur
> > OFtablo(POFtablo).gauche > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote > > > tablo(Ptablo).cote supprligne (Ptablo)
> >
> > ' On agrandi le tableau
> > POFtablo = POFtablo + 1
> > ReDim Preserve OFtablo(POFtablo)
> >
> > OFtablo(POFtablo).ref = "-"
> > OFtablo(POFtablo).dossier = "-"
> > OFtablo(POFtablo).rep = "-"
> > OFtablo(POFtablo).mod = "-"
> > OFtablo(POFtablo).teinte = "-"
> > OFtablo(POFtablo).qte = "0"
> > OFtablo(POFtablo).longueur = "0"
> > OFtablo(POFtablo).gauche = "-"
> > OFtablo(POFtablo).cote = "-"
> > GoTo line1
> >
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > pose probleme !!!
> > Else
> > lblFichier.Text = ""
> > For V = 0 To Ubount(OFtablo, 1)
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).dossier
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > lblFichier & "|" &
> > OFtablo(POFtablo).teinte
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > "|" &
> > OFtablo(POFtablo).longueur
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).gauche
> > lblFichier.Text = lblFichier & "|" &
> > OFtablo(POFtablo).cote & vbCrLf
> > Next V
> > End If
> > End Sub
> >
> > ------------------------------------
> >
> > Si qqun trouve pk , ca serai cool :)
> > Merci !
> >
> >
> > "Jean-Michel" a écrit dans le
> > message news: #
> >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> >> bloc If, alors que j'ai bien le bon nombre!
> >> Je crois que ca doit venir que du fait que quand le programme suit
> >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> >> le line1 par exemple, il est existe un end line1 ???
> >>
> >> Merci !
>
> Bonjour/soir,
>
> En réindentant un peu ton code, voici ce que je lis:
>
> If (Ptablo = UBound(tablo, 1)) Then
> 'point 1
> Select Case reste
> Case Is < minimachine
> line7: If (cycle = "ta") Then
> End If
> End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
pose
> probleme !!!
> Else
> ...
> On a au même niveau Select Case et End If
> Peut-être qu'un End Select serait plus approprié?
>
> Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> et sub pour les tâches répétées, remplacer les goto en série par des
do/loop
> ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> AMHA) ce genre d'erreurs.
>
> --
> François Picalausa (MVP VB)
> FAQ VB : http://faq.vb.free.fr
> MSDN : http://msdn.microsoft.com
>
>
Merci pour ta reponse
Heu, quel est la difference en variant et double !
Merci d'avance
"ng" a écrit dans le message news:
#
> Salut,
> Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
> semble que tu crois que :
>
> Dim minimachine, lame, arasage, min, max, profiles, reste As Double
>
> va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
> c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
juste?
>
> Petit exemple qui le prouve :
>
> Dim dNb1, dNb2 As Double
> Dim dNb3 As Double, dNb4 As Double
> Debug.Print VarType(dNb1)
> Debug.Print VarType(dNb2)
> Debug.Print VarType(dNb3)
> Debug.Print VarType(dNb4)
>
> Il faudra donc mettre des 'as double' pour chacune des variables !
>
> Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
place
> mémoire occupée par tes variables..
>
> Nicolas.
>
> "Jean-Michel" a écrit dans le
> message de news: O$
> > Ca a l'air de se debloquer, merci !
> >
> > "François Picalausa" a écrit dans le message
> >
> > > "Jean-Michel" a écrit dans
> > > message de news:%
> > > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > > pourrai faire !
> > > > ----------------
> > > >
> > > > Private Sub cmdChute_Click()
> > > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > > Double Dim LigneAEcrire As String
> > > > Dim Ptablo As Integer
> > > > Dim POFtablo As Integer
> > > > Dim cycle As String
> > > > Dim V As Integer
> > > > POFtablo = -1
> > > >
> > > > minimachine = 100
> > > > lame = 3.7
> > > > arasage = 20
> > > > min = 400
> > > > max = 800
> > > > profiles = 6000
> > > >
> > > > line1: Ptablo = 0
> > > > cycle = ""
> > > > If (Ptablo = UBound(tablo, 1)) Then
> > > > If (tablo(Ptablo).longueur <> 0) Then
> > > > reste = profiles - arasage -
tablo(Ptablo).longueur -
> > > > lame Else
> > > > ' on delimite et on passe à la longueur suivante
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
' -
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
'
> > > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
' -
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > > supprligne (Ptablo)
> > > > GoTo line1
> > > > End If
> > > >
> > > > line2: If reste < 800 Then
> > > > MsgBox ("Attention, les longueurs sont trop
grandes")
> > > > Else
> > > > ' On agrandi le tableau OFtablo
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > > supprligne (Ptablo)
> > > >
> > > > ' On soustrait la longueur suivante en verifiant
> > > > l'existance de longueur suivante
> > > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > > reste = reste - tablo(Ptablo).longueur - lame
> > > > Else
> > > > ' ce cycle est terminer en avertissant
d'utiliser
> > > > les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > 'point 1
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale à
> > > > max(800) GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > line5: reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > Ptablo = Ptablo + 1
> > > > GoTo line3
> > > > Case (reste >= minimachine And reste < min) '
> > > > > > (minimachine)100 mais < (min)400
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > Case Is < minimachine ' reste < (minimachine)100
> > > > reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > reste = reste - lame - minimachine
> > > > Do
> > > > If (tablo(Ptablo).longueur = 0) Then
> > > > GoTo line4
> > > > End If
> > > > Ptablo = Ptablo + 1
> > > > Loop While (tablo(Ptablo).longueur > reste)
> > > >
> > > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > > ' ce cycle est terminé en avertissant
> > > > d'utiliser les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > reste = reste - tablo(Ptablo).longueur +
> > > > minimachine
> > > >
> > > > 'point 2
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale
> > > > max(800)
> > > > GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > GoTo line5
> > > > Case Is < min ' rest < min(400)
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > End Select
> > > >
> > > > ' ->ce cycle est terminer
> > > > line6: If (cycle = "t") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > line7: If (cycle = "ta") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > > pose probleme !!!
> > > > Else
> > > > lblFichier.Text = ""
> > > > For V = 0 To Ubount(OFtablo, 1)
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).dossier
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier
> > > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > > lblFichier & "|" &
> > > > OFtablo(POFtablo).teinte
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).longueur
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).gauche
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).cote & vbCrLf
> > > > Next V
> > > > End If
> > > > End Sub
> > > >
> > > > ------------------------------------
> > > >
> > > > Si qqun trouve pk , ca serai cool :)
> > > > Merci !
> > > >
> > > >
> > > > "Jean-Michel" a écrit dans
le
> > > > message news: #
> > > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 :
> > > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > > >> bloc If, alors que j'ai bien le bon nombre!
> > > >> Je crois que ca doit venir que du fait que quand le programme
> > > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > > >> End If, ca doit le gener, alors je voudrai savoir comment
> > > >> le line1 par exemple, il est existe un end line1 ???
> > > >>
> > > >> Merci !
> > >
> > > Bonjour/soir,
> > >
> > > En réindentant un peu ton code, voici ce que je lis:
> > >
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > 'point 1
> > > Select Case reste
> > > Case Is < minimachine
> > > line7: If (cycle = "ta") Then
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If
> > pose
> > > probleme !!!
> > > Else
> > > ...
> > > On a au même niveau Select Case et End If
> > > Peut-être qu'un End Select serait plus approprié?
> > >
> > > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> fonctions
> > > et sub pour les tâches répétées, remplacer les goto en série par des
> > do/loop
> > > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> (toujours
> > > AMHA) ce genre d'erreurs.
> > >
> > > --
> > > François Picalausa (MVP VB)
> > > FAQ VB : http://faq.vb.free.fr
> > > MSDN : http://msdn.microsoft.com
> > >
> > >
> >
> >
>
>
Merci pour ta reponse
Heu, quel est la difference en variant et double !
Merci d'avance
"ng" <ng@babeuk.net> a écrit dans le message news:
#3lHpRTqDHA.2676@TK2MSFTNGP11.phx.gbl...
> Salut,
> Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
> semble que tu crois que :
>
> Dim minimachine, lame, arasage, min, max, profiles, reste As Double
>
> va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
> c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
juste?
>
> Petit exemple qui le prouve :
>
> Dim dNb1, dNb2 As Double
> Dim dNb3 As Double, dNb4 As Double
> Debug.Print VarType(dNb1)
> Debug.Print VarType(dNb2)
> Debug.Print VarType(dNb3)
> Debug.Print VarType(dNb4)
>
> Il faudra donc mettre des 'as double' pour chacune des variables !
>
> Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
place
> mémoire occupée par tes variables..
>
> Nicolas.
>
> "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
> message de news: O$QbUXSqDHA.392@TK2MSFTNGP11.phx.gbl...
> > Ca a l'air de se debloquer, merci !
> >
> > "François Picalausa" <fpicalausa@chez.com> a écrit dans le message
> > OaqH5NSqDHA.3732@tk2msftngp13.phx.gbl...
> > > "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans
> > > message de news:%23j2uEHSqDHA.1632@TK2MSFTNGP10.phx.gbl
> > > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > > pourrai faire !
> > > > ----------------
> > > >
> > > > Private Sub cmdChute_Click()
> > > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > > Double Dim LigneAEcrire As String
> > > > Dim Ptablo As Integer
> > > > Dim POFtablo As Integer
> > > > Dim cycle As String
> > > > Dim V As Integer
> > > > POFtablo = -1
> > > >
> > > > minimachine = 100
> > > > lame = 3.7
> > > > arasage = 20
> > > > min = 400
> > > > max = 800
> > > > profiles = 6000
> > > >
> > > > line1: Ptablo = 0
> > > > cycle = ""
> > > > If (Ptablo = UBound(tablo, 1)) Then
> > > > If (tablo(Ptablo).longueur <> 0) Then
> > > > reste = profiles - arasage -
tablo(Ptablo).longueur -
> > > > lame Else
> > > > ' on delimite et on passe à la longueur suivante
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
' -
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
'
> > > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
' -
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > > supprligne (Ptablo)
> > > > GoTo line1
> > > > End If
> > > >
> > > > line2: If reste < 800 Then
> > > > MsgBox ("Attention, les longueurs sont trop
grandes")
> > > > Else
> > > > ' On agrandi le tableau OFtablo
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > > supprligne (Ptablo)
> > > >
> > > > ' On soustrait la longueur suivante en verifiant
> > > > l'existance de longueur suivante
> > > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > > reste = reste - tablo(Ptablo).longueur - lame
> > > > Else
> > > > ' ce cycle est terminer en avertissant
d'utiliser
> > > > les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > 'point 1
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale à
> > > > max(800) GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > line5: reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > Ptablo = Ptablo + 1
> > > > GoTo line3
> > > > Case (reste >= minimachine And reste < min) '
> > > > > > (minimachine)100 mais < (min)400
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > Case Is < minimachine ' reste < (minimachine)100
> > > > reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > reste = reste - lame - minimachine
> > > > Do
> > > > If (tablo(Ptablo).longueur = 0) Then
> > > > GoTo line4
> > > > End If
> > > > Ptablo = Ptablo + 1
> > > > Loop While (tablo(Ptablo).longueur > reste)
> > > >
> > > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > > ' ce cycle est terminé en avertissant
> > > > d'utiliser les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > reste = reste - tablo(Ptablo).longueur +
> > > > minimachine
> > > >
> > > > 'point 2
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale
> > > > max(800)
> > > > GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > GoTo line5
> > > > Case Is < min ' rest < min(400)
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > End Select
> > > >
> > > > ' ->ce cycle est terminer
> > > > line6: If (cycle = "t") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > line7: If (cycle = "ta") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > > pose probleme !!!
> > > > Else
> > > > lblFichier.Text = ""
> > > > For V = 0 To Ubount(OFtablo, 1)
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).dossier
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier
> > > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > > lblFichier & "|" &
> > > > OFtablo(POFtablo).teinte
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).longueur
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).gauche
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).cote & vbCrLf
> > > > Next V
> > > > End If
> > > > End Sub
> > > >
> > > > ------------------------------------
> > > >
> > > > Si qqun trouve pk , ca serai cool :)
> > > > Merci !
> > > >
> > > >
> > > > "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans
le
> > > > message news: #9rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl...
> > > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 :
> > > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > > >> bloc If, alors que j'ai bien le bon nombre!
> > > >> Je crois que ca doit venir que du fait que quand le programme
> > > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > > >> End If, ca doit le gener, alors je voudrai savoir comment
> > > >> le line1 par exemple, il est existe un end line1 ???
> > > >>
> > > >> Merci !
> > >
> > > Bonjour/soir,
> > >
> > > En réindentant un peu ton code, voici ce que je lis:
> > >
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > 'point 1
> > > Select Case reste
> > > Case Is < minimachine
> > > line7: If (cycle = "ta") Then
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If
> > pose
> > > probleme !!!
> > > Else
> > > ...
> > > On a au même niveau Select Case et End If
> > > Peut-être qu'un End Select serait plus approprié?
> > >
> > > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> fonctions
> > > et sub pour les tâches répétées, remplacer les goto en série par des
> > do/loop
> > > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> (toujours
> > > AMHA) ce genre d'erreurs.
> > >
> > > --
> > > François Picalausa (MVP VB)
> > > FAQ VB : http://faq.vb.free.fr
> > > MSDN : http://msdn.microsoft.com
> > >
> > >
> >
> >
>
>
Merci pour ta reponse
Heu, quel est la difference en variant et double !
Merci d'avance
"ng" a écrit dans le message news:
#
> Salut,
> Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
> semble que tu crois que :
>
> Dim minimachine, lame, arasage, min, max, profiles, reste As Double
>
> va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
> c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
juste?
>
> Petit exemple qui le prouve :
>
> Dim dNb1, dNb2 As Double
> Dim dNb3 As Double, dNb4 As Double
> Debug.Print VarType(dNb1)
> Debug.Print VarType(dNb2)
> Debug.Print VarType(dNb3)
> Debug.Print VarType(dNb4)
>
> Il faudra donc mettre des 'as double' pour chacune des variables !
>
> Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
place
> mémoire occupée par tes variables..
>
> Nicolas.
>
> "Jean-Michel" a écrit dans le
> message de news: O$
> > Ca a l'air de se debloquer, merci !
> >
> > "François Picalausa" a écrit dans le message
> >
> > > "Jean-Michel" a écrit dans
> > > message de news:%
> > > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > > pourrai faire !
> > > > ----------------
> > > >
> > > > Private Sub cmdChute_Click()
> > > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > > Double Dim LigneAEcrire As String
> > > > Dim Ptablo As Integer
> > > > Dim POFtablo As Integer
> > > > Dim cycle As String
> > > > Dim V As Integer
> > > > POFtablo = -1
> > > >
> > > > minimachine = 100
> > > > lame = 3.7
> > > > arasage = 20
> > > > min = 400
> > > > max = 800
> > > > profiles = 6000
> > > >
> > > > line1: Ptablo = 0
> > > > cycle = ""
> > > > If (Ptablo = UBound(tablo, 1)) Then
> > > > If (tablo(Ptablo).longueur <> 0) Then
> > > > reste = profiles - arasage -
tablo(Ptablo).longueur -
> > > > lame Else
> > > > ' on delimite et on passe à la longueur suivante
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
' -
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
'
> > > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
' -
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > > supprligne (Ptablo)
> > > > GoTo line1
> > > > End If
> > > >
> > > > line2: If reste < 800 Then
> > > > MsgBox ("Attention, les longueurs sont trop
grandes")
> > > > Else
> > > > ' On agrandi le tableau OFtablo
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > > OFtablo(POFtablo).longueur tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > > supprligne (Ptablo)
> > > >
> > > > ' On soustrait la longueur suivante en verifiant
> > > > l'existance de longueur suivante
> > > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > > reste = reste - tablo(Ptablo).longueur - lame
> > > > Else
> > > > ' ce cycle est terminer en avertissant
d'utiliser
> > > > les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > 'point 1
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale à
> > > > max(800) GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > line5: reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > Ptablo = Ptablo + 1
> > > > GoTo line3
> > > > Case (reste >= minimachine And reste < min) '
> > > > > > (minimachine)100 mais < (min)400
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > Case Is < minimachine ' reste < (minimachine)100
> > > > reste = reste + tablo(Ptablo).longueur + lame
on
> > > > annule la derniere longueur
> > > > reste = reste - lame - minimachine
> > > > Do
> > > > If (tablo(Ptablo).longueur = 0) Then
> > > > GoTo line4
> > > > End If
> > > > Ptablo = Ptablo + 1
> > > > Loop While (tablo(Ptablo).longueur > reste)
> > > >
> > > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > > ' ce cycle est terminé en avertissant
> > > > d'utiliser les chutes
> > > > cycle = "ta"
> > > > GoTo line7
> > > > End If
> > > >
> > > > reste = reste - tablo(Ptablo).longueur +
> > > > minimachine
> > > >
> > > > 'point 2
> > > > Select Case reste
> > > > Case Is >= max ' reste est plus grand ou egale
> > > > max(800)
> > > > GoTo line2
> > > > Case (reste >= min And reste < max) ' reste > > > > > > min(400) mais < max(800)
> > > > GoTo line5
> > > > Case Is < min ' rest < min(400)
> > > > ' ce cycle est terminé
> > > > cycle = "t"
> > > > GoTo line6
> > > > End Select
> > > >
> > > > ' ->ce cycle est terminer
> > > > line6: If (cycle = "t") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > line7: If (cycle = "ta") Then
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > ' On retient pour l'OF
> > > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > > OFtablo(POFtablo).dossier > > > > > tablo(Ptablo).dossier
> > > > > tablo(Ptablo).rep OFtablo(POFtablo).mod > > > > > tablo(Ptablo).mod OFtablo(POFtablo).teinte
> > > > = tablo(Ptablo).longueur
> > > > OFtablo(POFtablo).gauche > > > > > tablo(Ptablo).gauche
> > > > > tablo(Ptablo).cote supprligne (Ptablo)
> > > >
> > > > ' On agrandi le tableau
> > > > POFtablo = POFtablo + 1
> > > > ReDim Preserve OFtablo(POFtablo)
> > > >
> > > > OFtablo(POFtablo).ref = "-"
> > > > OFtablo(POFtablo).dossier = "-"
> > > > OFtablo(POFtablo).rep = "-"
> > > > OFtablo(POFtablo).mod = "-"
> > > > OFtablo(POFtablo).teinte = "-"
> > > > OFtablo(POFtablo).qte = "0"
> > > > OFtablo(POFtablo).longueur = "0"
> > > > OFtablo(POFtablo).gauche = "-"
> > > > OFtablo(POFtablo).cote = "-"
> > > > GoTo line1
> > > >
> > > > End If
> > > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > > pose probleme !!!
> > > > Else
> > > > lblFichier.Text = ""
> > > > For V = 0 To Ubount(OFtablo, 1)
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).dossier
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier
> > > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > > lblFichier & "|" &
> > > > OFtablo(POFtablo).teinte
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier
> > > > "|" &
> > > > OFtablo(POFtablo).longueur
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).gauche
> > > > lblFichier.Text = lblFichier & "|" &
> > > > OFtablo(POFtablo).cote & vbCrLf
> > > > Next V
> > > > End If
> > > > End Sub
> > > >
> > > > ------------------------------------
> > > >
> > > > Si qqun trouve pk , ca serai cool :)
> > > > Merci !
> > > >
> > > >
> > > > "Jean-Michel" a écrit dans
le
> > > > message news: #
> > > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 :
> > > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > > >> bloc If, alors que j'ai bien le bon nombre!
> > > >> Je crois que ca doit venir que du fait que quand le programme
> > > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > > >> End If, ca doit le gener, alors je voudrai savoir comment
> > > >> le line1 par exemple, il est existe un end line1 ???
> > > >>
> > > >> Merci !
> > >
> > > Bonjour/soir,
> > >
> > > En réindentant un peu ton code, voici ce que je lis:
> > >
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > 'point 1
> > > Select Case reste
> > > Case Is < minimachine
> > > line7: If (cycle = "ta") Then
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If
> > pose
> > > probleme !!!
> > > Else
> > > ...
> > > On a au même niveau Select Case et End If
> > > Peut-être qu'un End Select serait plus approprié?
> > >
> > > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
> fonctions
> > > et sub pour les tâches répétées, remplacer les goto en série par des
> > do/loop
> > > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
> (toujours
> > > AMHA) ce genre d'erreurs.
> > >
> > > --
> > > François Picalausa (MVP VB)
> > > FAQ VB : http://faq.vb.free.fr
> > > MSDN : http://msdn.microsoft.com
> > >
> > >
> >
> >
>
>
Salut,
Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
semble que tu crois que :
Dim minimachine, lame, arasage, min, max, profiles, reste As Double
va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
Petit exemple qui le prouve :
Dim dNb1, dNb2 As Double
Dim dNb3 As Double, dNb4 As Double
Debug.Print VarType(dNb1)
Debug.Print VarType(dNb2)
Debug.Print VarType(dNb3)
Debug.Print VarType(dNb4)
Il faudra donc mettre des 'as double' pour chacune des variables !
Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
mémoire occupée par tes variables..
Nicolas.
"Jean-Michel" a écrit dans le
message de news: O$
> Ca a l'air de se debloquer, merci !
>
> "François Picalausa" a écrit dans le message news:
>
> > "Jean-Michel" a écrit dans le
> > message de news:%
> > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > pourrai faire !
> > > ----------------
> > >
> > > Private Sub cmdChute_Click()
> > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > Double Dim LigneAEcrire As String
> > > Dim Ptablo As Integer
> > > Dim POFtablo As Integer
> > > Dim cycle As String
> > > Dim V As Integer
> > > POFtablo = -1
> > >
> > > minimachine = 100
> > > lame = 3.7
> > > arasage = 20
> > > min = 400
> > > max = 800
> > > profiles = 6000
> > >
> > > line1: Ptablo = 0
> > > cycle = ""
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > If (tablo(Ptablo).longueur <> 0) Then
> > > reste = profiles - arasage -
> > > lame Else
> > > ' on delimite et on passe à la longueur suivante
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > supprligne (Ptablo)
> > > GoTo line1
> > > End If
> > >
> > > line2: If reste < 800 Then
> > > MsgBox ("Attention, les longueurs sont trop
> > > Else
> > > ' On agrandi le tableau OFtablo
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > supprligne (Ptablo)
> > >
> > > ' On soustrait la longueur suivante en verifiant
> > > l'existance de longueur suivante
> > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > reste = reste - tablo(Ptablo).longueur - lame
> > > Else
> > > ' ce cycle est terminer en avertissant
> > > les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > 'point 1
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800) GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > line5: reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > Ptablo = Ptablo + 1
> > > GoTo line3
> > > Case (reste >= minimachine And reste < min) ' reste
> > > > (minimachine)100 mais < (min)400
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > Case Is < minimachine ' reste < (minimachine)100
> > > reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > reste = reste - lame - minimachine
> > > Do
> > > If (tablo(Ptablo).longueur = 0) Then
> > > GoTo line4
> > > End If
> > > Ptablo = Ptablo + 1
> > > Loop While (tablo(Ptablo).longueur > reste)
> > >
> > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > ' ce cycle est terminé en avertissant
> > > d'utiliser les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > reste = reste - tablo(Ptablo).longueur +
> > > minimachine
> > >
> > > 'point 2
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800)
> > > GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > GoTo line5
> > > Case Is < min ' rest < min(400)
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > End Select
> > >
> > > ' ->ce cycle est terminer
> > > line6: If (cycle = "t") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > line7: If (cycle = "ta") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > pose probleme !!!
> > > Else
> > > lblFichier.Text = ""
> > > For V = 0 To Ubount(OFtablo, 1)
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).dossier
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > lblFichier & "|" &
> > > OFtablo(POFtablo).teinte
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).longueur
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).gauche
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).cote & vbCrLf
> > > Next V
> > > End If
> > > End Sub
> > >
> > > ------------------------------------
> > >
> > > Si qqun trouve pk , ca serai cool :)
> > > Merci !
> > >
> > >
> > > "Jean-Michel" a écrit dans
> > > message news: #
> > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > >> bloc If, alors que j'ai bien le bon nombre!
> > >> Je crois que ca doit venir que du fait que quand le programme suit
> > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> > >> le line1 par exemple, il est existe un end line1 ???
> > >>
> > >> Merci !
> >
> > Bonjour/soir,
> >
> > En réindentant un peu ton code, voici ce que je lis:
> >
> > If (Ptablo = UBound(tablo, 1)) Then
> > 'point 1
> > Select Case reste
> > Case Is < minimachine
> > line7: If (cycle = "ta") Then
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose
> > probleme !!!
> > Else
> > ...
> > On a au même niveau Select Case et End If
> > Peut-être qu'un End Select serait plus approprié?
> >
> > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
fonctions
> > et sub pour les tâches répétées, remplacer les goto en série par des
> do/loop
> > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
(toujours
> > AMHA) ce genre d'erreurs.
> >
> > --
> > François Picalausa (MVP VB)
> > FAQ VB : http://faq.vb.free.fr
> > MSDN : http://msdn.microsoft.com
> >
> >
>
>
Salut,
Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
semble que tu crois que :
Dim minimachine, lame, arasage, min, max, profiles, reste As Double
va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
Petit exemple qui le prouve :
Dim dNb1, dNb2 As Double
Dim dNb3 As Double, dNb4 As Double
Debug.Print VarType(dNb1)
Debug.Print VarType(dNb2)
Debug.Print VarType(dNb3)
Debug.Print VarType(dNb4)
Il faudra donc mettre des 'as double' pour chacune des variables !
Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
mémoire occupée par tes variables..
Nicolas.
"Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
message de news: O$QbUXSqDHA.392@TK2MSFTNGP11.phx.gbl...
> Ca a l'air de se debloquer, merci !
>
> "François Picalausa" <fpicalausa@chez.com> a écrit dans le message news:
> OaqH5NSqDHA.3732@tk2msftngp13.phx.gbl...
> > "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans le
> > message de news:%23j2uEHSqDHA.1632@TK2MSFTNGP10.phx.gbl
> > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > pourrai faire !
> > > ----------------
> > >
> > > Private Sub cmdChute_Click()
> > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > Double Dim LigneAEcrire As String
> > > Dim Ptablo As Integer
> > > Dim POFtablo As Integer
> > > Dim cycle As String
> > > Dim V As Integer
> > > POFtablo = -1
> > >
> > > minimachine = 100
> > > lame = 3.7
> > > arasage = 20
> > > min = 400
> > > max = 800
> > > profiles = 6000
> > >
> > > line1: Ptablo = 0
> > > cycle = ""
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > If (tablo(Ptablo).longueur <> 0) Then
> > > reste = profiles - arasage -
> > > lame Else
> > > ' on delimite et on passe à la longueur suivante
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > supprligne (Ptablo)
> > > GoTo line1
> > > End If
> > >
> > > line2: If reste < 800 Then
> > > MsgBox ("Attention, les longueurs sont trop
> > > Else
> > > ' On agrandi le tableau OFtablo
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > supprligne (Ptablo)
> > >
> > > ' On soustrait la longueur suivante en verifiant
> > > l'existance de longueur suivante
> > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > reste = reste - tablo(Ptablo).longueur - lame
> > > Else
> > > ' ce cycle est terminer en avertissant
> > > les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > 'point 1
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800) GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > line5: reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > Ptablo = Ptablo + 1
> > > GoTo line3
> > > Case (reste >= minimachine And reste < min) ' reste
> > > > (minimachine)100 mais < (min)400
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > Case Is < minimachine ' reste < (minimachine)100
> > > reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > reste = reste - lame - minimachine
> > > Do
> > > If (tablo(Ptablo).longueur = 0) Then
> > > GoTo line4
> > > End If
> > > Ptablo = Ptablo + 1
> > > Loop While (tablo(Ptablo).longueur > reste)
> > >
> > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > ' ce cycle est terminé en avertissant
> > > d'utiliser les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > reste = reste - tablo(Ptablo).longueur +
> > > minimachine
> > >
> > > 'point 2
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800)
> > > GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > GoTo line5
> > > Case Is < min ' rest < min(400)
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > End Select
> > >
> > > ' ->ce cycle est terminer
> > > line6: If (cycle = "t") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > line7: If (cycle = "ta") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > pose probleme !!!
> > > Else
> > > lblFichier.Text = ""
> > > For V = 0 To Ubount(OFtablo, 1)
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).dossier
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > lblFichier & "|" &
> > > OFtablo(POFtablo).teinte
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).longueur
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).gauche
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).cote & vbCrLf
> > > Next V
> > > End If
> > > End Sub
> > >
> > > ------------------------------------
> > >
> > > Si qqun trouve pk , ca serai cool :)
> > > Merci !
> > >
> > >
> > > "Jean-Michel" <jeneveuxpasdespam_coconuts@genial.net> a écrit dans
> > > message news: #9rB16RqDHA.2268@TK2MSFTNGP12.phx.gbl...
> > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > >> bloc If, alors que j'ai bien le bon nombre!
> > >> Je crois que ca doit venir que du fait que quand le programme suit
> > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> > >> le line1 par exemple, il est existe un end line1 ???
> > >>
> > >> Merci !
> >
> > Bonjour/soir,
> >
> > En réindentant un peu ton code, voici ce que je lis:
> >
> > If (Ptablo = UBound(tablo, 1)) Then
> > 'point 1
> > Select Case reste
> > Case Is < minimachine
> > line7: If (cycle = "ta") Then
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose
> > probleme !!!
> > Else
> > ...
> > On a au même niveau Select Case et End If
> > Peut-être qu'un End Select serait plus approprié?
> >
> > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
fonctions
> > et sub pour les tâches répétées, remplacer les goto en série par des
> do/loop
> > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
(toujours
> > AMHA) ce genre d'erreurs.
> >
> > --
> > François Picalausa (MVP VB)
> > FAQ VB : http://faq.vb.free.fr
> > MSDN : http://msdn.microsoft.com
> >
> >
>
>
Salut,
Petite remarque qui a son importance, j'ai pas lu tout ton code mais il
semble que tu crois que :
Dim minimachine, lame, arasage, min, max, profiles, reste As Double
va définir 'minimachine, lame, arasage, min, max, profiles' en Double or
c'est faux, seul 'reste' sera en Double, et le reste en Variant c'est
Petit exemple qui le prouve :
Dim dNb1, dNb2 As Double
Dim dNb3 As Double, dNb4 As Double
Debug.Print VarType(dNb1)
Debug.Print VarType(dNb2)
Debug.Print VarType(dNb3)
Debug.Print VarType(dNb4)
Il faudra donc mettre des 'as double' pour chacune des variables !
Je te dis ca car ca va bcp jouer sur la rapidité de ton code et sur la
mémoire occupée par tes variables..
Nicolas.
"Jean-Michel" a écrit dans le
message de news: O$
> Ca a l'air de se debloquer, merci !
>
> "François Picalausa" a écrit dans le message news:
>
> > "Jean-Michel" a écrit dans le
> > message de news:%
> > > Mon code est un peu long mais bon, j'ai du mal a voir comment je
> > > pourrai faire !
> > > ----------------
> > >
> > > Private Sub cmdChute_Click()
> > > Dim minimachine, lame, arasage, min, max, profiles, reste As
> > > Double Dim LigneAEcrire As String
> > > Dim Ptablo As Integer
> > > Dim POFtablo As Integer
> > > Dim cycle As String
> > > Dim V As Integer
> > > POFtablo = -1
> > >
> > > minimachine = 100
> > > lame = 3.7
> > > arasage = 20
> > > min = 400
> > > max = 800
> > > profiles = 6000
> > >
> > > line1: Ptablo = 0
> > > cycle = ""
> > > If (Ptablo = UBound(tablo, 1)) Then
> > > If (tablo(Ptablo).longueur <> 0) Then
> > > reste = profiles - arasage -
> > > lame Else
> > > ' on delimite et on passe à la longueur suivante
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref ' -
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep ' -
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod ' -
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte ' -
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte ' 0
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > 0 OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote ' -
> > > supprligne (Ptablo)
> > > GoTo line1
> > > End If
> > >
> > > line2: If reste < 800 Then
> > > MsgBox ("Attention, les longueurs sont trop
> > > Else
> > > ' On agrandi le tableau OFtablo
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier = tablo(Ptablo).dossier
> > > OFtablo(POFtablo).rep = tablo(Ptablo).rep
> > > OFtablo(POFtablo).mod = tablo(Ptablo).mod
> > > OFtablo(POFtablo).teinte = tablo(Ptablo).teinte
> > > OFtablo(POFtablo).qte = tablo(Ptablo).qte
> > > OFtablo(POFtablo).longueur = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche = tablo(Ptablo).gauche
> > > OFtablo(POFtablo).cote = tablo(Ptablo).cote
> > > supprligne (Ptablo)
> > >
> > > ' On soustrait la longueur suivante en verifiant
> > > l'existance de longueur suivante
> > > line3: If (tablo(Ptablo).longueur > 0) Then
> > > reste = reste - tablo(Ptablo).longueur - lame
> > > Else
> > > ' ce cycle est terminer en avertissant
> > > les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > 'point 1
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800) GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > line5: reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > Ptablo = Ptablo + 1
> > > GoTo line3
> > > Case (reste >= minimachine And reste < min) ' reste
> > > > (minimachine)100 mais < (min)400
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > Case Is < minimachine ' reste < (minimachine)100
> > > reste = reste + tablo(Ptablo).longueur + lame '
> > > annule la derniere longueur
> > > reste = reste - lame - minimachine
> > > Do
> > > If (tablo(Ptablo).longueur = 0) Then
> > > GoTo line4
> > > End If
> > > Ptablo = Ptablo + 1
> > > Loop While (tablo(Ptablo).longueur > reste)
> > >
> > > line4: If (tablo(Ptablo).longueur = 0) Then
> > > ' ce cycle est terminé en avertissant
> > > d'utiliser les chutes
> > > cycle = "ta"
> > > GoTo line7
> > > End If
> > >
> > > reste = reste - tablo(Ptablo).longueur +
> > > minimachine
> > >
> > > 'point 2
> > > Select Case reste
> > > Case Is >= max ' reste est plus grand ou egale à
> > > max(800)
> > > GoTo line2
> > > Case (reste >= min And reste < max) ' reste > > > > > min(400) mais < max(800)
> > > GoTo line5
> > > Case Is < min ' rest < min(400)
> > > ' ce cycle est terminé
> > > cycle = "t"
> > > GoTo line6
> > > End Select
> > >
> > > ' ->ce cycle est terminer
> > > line6: If (cycle = "t") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > line7: If (cycle = "ta") Then
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > ' On retient pour l'OF
> > > OFtablo(POFtablo).ref = tablo(Ptablo).ref
> > > OFtablo(POFtablo).dossier > > > > tablo(Ptablo).dossier OFtablo(POFtablo).rep
> > > = tablo(Ptablo).longueur
> > > OFtablo(POFtablo).gauche > > > > tablo(Ptablo).gauche OFtablo(POFtablo).cote
> > >
> > > ' On agrandi le tableau
> > > POFtablo = POFtablo + 1
> > > ReDim Preserve OFtablo(POFtablo)
> > >
> > > OFtablo(POFtablo).ref = "-"
> > > OFtablo(POFtablo).dossier = "-"
> > > OFtablo(POFtablo).rep = "-"
> > > OFtablo(POFtablo).mod = "-"
> > > OFtablo(POFtablo).teinte = "-"
> > > OFtablo(POFtablo).qte = "0"
> > > OFtablo(POFtablo).longueur = "0"
> > > OFtablo(POFtablo).gauche = "-"
> > > OFtablo(POFtablo).cote = "-"
> > > GoTo line1
> > >
> > > End If
> > > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> > > pose probleme !!!
> > > Else
> > > lblFichier.Text = ""
> > > For V = 0 To Ubount(OFtablo, 1)
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).ref lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).dossier
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).rep lblFichier.Text = lblFichier &
> > > "|" & OFtablo(POFtablo).mod lblFichier.Text > > > > lblFichier & "|" &
> > > OFtablo(POFtablo).teinte
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).qte lblFichier.Text = lblFichier &
> > > "|" &
> > > OFtablo(POFtablo).longueur
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).gauche
> > > lblFichier.Text = lblFichier & "|" &
> > > OFtablo(POFtablo).cote & vbCrLf
> > > Next V
> > > End If
> > > End Sub
> > >
> > > ------------------------------------
> > >
> > > Si qqun trouve pk , ca serai cool :)
> > > Merci !
> > >
> > >
> > > "Jean-Michel" a écrit dans
> > > message news: #
> > >> Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou
> > >> line 2: Du coup, ca me met plein d'erreur du type End If sans le
> > >> bloc If, alors que j'ai bien le bon nombre!
> > >> Je crois que ca doit venir que du fait que quand le programme suit
> > >> le goto, et que je lui fait rentrer dans un bloc, et qu'il troude
> > >> End If, ca doit le gener, alors je voudrai savoir comment délimité
> > >> le line1 par exemple, il est existe un end line1 ???
> > >>
> > >> Merci !
> >
> > Bonjour/soir,
> >
> > En réindentant un peu ton code, voici ce que je lis:
> >
> > If (Ptablo = UBound(tablo, 1)) Then
> > 'point 1
> > Select Case reste
> > Case Is < minimachine
> > line7: If (cycle = "ta") Then
> > End If
> > End If <<<<<<<<<<<<<<<<<<<<<<< C'est sur ce End If qui
> pose
> > probleme !!!
> > Else
> > ...
> > On a au même niveau Select Case et End If
> > Peut-être qu'un End Select serait plus approprié?
> >
> > Il faudrait (mais je ne comprend pas bien ce code) faire diverse
fonctions
> > et sub pour les tâches répétées, remplacer les goto en série par des
> do/loop
> > ou autre et ce serait alors, AMHA, plus lisible et ça éviterais
(toujours
> > AMHA) ce genre d'erreurs.
> >
> > --
> > François Picalausa (MVP VB)
> > FAQ VB : http://faq.vb.free.fr
> > MSDN : http://msdn.microsoft.com
> >
> >
>
>
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !
Bonjour, pour mon programme, j'utilise des goto vers des line1 : ou line
Du coup, ca me met plein d'erreur du type End If sans le bloc If, alors
j'ai bien le bon nombre!
Je crois que ca doit venir que du fait que quand le programme suit le
et que je lui fait rentrer dans un bloc, et qu'il troude End If, ca doit
gener, alors je voudrai savoir comment délimité le line1 par exemple, il
existe un end line1 ???
Merci !