Je lui ai donné à lire le dernier article de futura science sur le LHC
Quelque bug et boucles infinis à corriger
il parle enfin mais n'est pas loquace, maximum 3 mots
Il va falloir lui donner d'autres lecture
Code:'Parleur Private Sub BtParle_Click() Set T = CurrentDb.OpenRecordset("select max(N) as mn from Mots") n = Int(Rnd() * T!mn) Set T = CurrentDb.OpenRecordset("select Mot from Mots where N=" & n) Me!parle = T!Mot n1 = n Do Set T = CurrentDb.OpenRecordset("select Max(Nbre) as mn from Droite where IdMot=" & n) If T.EOF Or IsNull(T!mn) Then Exit Do End If Set T = CurrentDb.OpenRecordset("select IdDroite from Droite where Nbre=" & T!mn) np = n n = T!IdDroite If n = n1 Or n = np Then Exit Do End If Set T = CurrentDb.OpenRecordset("select Mot from Mots where N=" & n) Me!parle = Me!parle & " " & T!Mot Loop End Sub 'Lectueur Private Sub Commande0_Click() Nom = GetNomFich("Fichier texte", CurrentDb.Name) Open Nom For Input As 2 ' Ouvre le fichier texte. Do Until EOF(2) Line Input #2, T b = Split(T, " ") n = UBound(b) g = 0 For I = 1 To n C = b(I) req = "select N from Mots where Mot=""" & C & """" Set T = CurrentDb.OpenRecordset(req) If T.EOF Then Set T = CurrentDb.OpenRecordset("Mots") T.AddNew T!Mot = C T.Update End If If g > 0 Then Set ta = CurrentDb.OpenRecordset("select Nbre from Droite Where IdMot=" & g & " and IdDroite=" & T!n) If ta.EOF Then Set ta = CurrentDb.OpenRecordset("Droite") ta.AddNew ta!IdMot = g ta!IdDroite = T!n ta!Nbre = 1 ta.Update Else ta.Edit ta!Nbre = ta!Nbre + 1 ta.Update End If End If g = T.n Next I Loop Close #2 End Sub
-----