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
| Option Explicit
Dim I, Tb(30), n
For i = Wscript.Arguments.Count - 1 to 1 Step - 1
'MsgBox WScript.Arguments(i)
Tb(i) = WScript.Arguments(i)
next
n = Wscript.Arguments.Count - 1
Tri n, Tb
For i = UBound(Tb) To LBound(Tb) Step - 1
If Tb(i) <> "" Then MsgBox Tb(i)
Next
'Il faut faire un tri avant l'envoi au script
'=========================
Sub Tri(m,Tb)
Dim i, pos, j, aux
FOR i = 2 TO m
pos = i-1
' Si on veut un tri avec respect de la casse, on doit enlever le 'LCase' de la ligne suivante
WHILE (pos>=1) and (LCase(Tb(pos)) < LCase(Tb(i)))
pos= pos-1
Wend
pos = pos + 1
aux = (Tb(i))
FOR j = (i-1) To pos Step -1
Tb(j+1) = Tb(j)
Next
Tb(pos) = aux
Next
End Sub
'===========================' |
Partager