1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| SUb liste_attente(message)
Dim OFS, oLigne
Dim bLigne1lue
Dim sLigne
Const ForReading = 1, ForWriting = 2
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFlu = oFSO.OpenTextFile("c:\fichier1.txt", ForReading)
Do While Not oFlu.AtEndOfStream
'Récupération valeur compteur
sLigne = oFlu.ReadLine
Loop
oFlu.close
If sLigne=0 Then
ma_fonction(message)
Else
interval_de_temps=5
'ma_fonction(message) dans sLigne*interval_de_temps, qui s'executera donc plsu tard
'Incrémentation
nouveau=sLigne+1
Set oFec = oFSO.OpenTextFile("c:\fichier1.txt", ForWriting,true)
'Enregistrement
oFec.WriteLine (nouveau)
oFec.close
End If
End Sub |
Partager