OVH Cloud OVH Cloud

[HS] Voeu

3 réponses
Avatar
garnote
Sub Serge()
D = Array(48, 122, 142, 102, 134, 140, -36, 56, 122, _
370, 116, -36, -34, "M", "P", "F", "E")
For I = 0 To 16
If I <= 12 Then R = R & Chr((D(I) + 100) / 2) _
Else E = E + Asc(D(I))
Next I
MsgBox R, (E - 40) / 4, ""
End Sub

;-)

3 réponses

Avatar
gamma60
merci Garnote et la même chose pour toi
mais.... je n'arrive pas à faire apparaitre le destinataire du message . Que
faire ?
bonne fin d'année

--
gamma60
Avatar
LSteph
Bonjour Serge,

Joyeux Noêl à toi!
(..j'ai juste pas compris: la fin de cet Array se retrouve où?..)

lSteph

"garnote" a écrit dans le message de news:

Sub Serge()
D = Array(48, 122, 142, 102, 134, 140, -36, 56, 122, _
370, 116, -36, -34, "M", "P", "F", "E")
For I = 0 To 16
If I <= 12 Then R = R & Chr((D(I) + 100) / 2) _
Else E = E + Asc(D(I))
Next I
MsgBox R, (E - 40) / 4, ""
End Sub

;-)




Avatar
Michel Gaboly
Merci, à toi aussi


Pour que cela fonctionne aussi sur Mac (code ASCII diffère selon les OS pour les caractères accentués) :

Sub Serge()
d = Array(48, 122, 142, 102, 134, 140, -36, 56, 122, 370, 116, _
-36, -34, "M", "P", "F", "E")
If Left(Application.OperatingSystem, 1) = "M" Then d(9) = 190
For I = 0 To 16
If I <= 12 Then R = R & Chr((d(I) + 100) / 2) _
Else E = E + Asc(d(I))
Next I
MsgBox R, (E - 40) / 4, ""
End Sub

ou

Sub Serge()
d = Array(48, 122, 142, 102, 134, 140, -36, 56, 122, 370, 116, _
-36, -34, "M", "P", "F", "E")
d(9) = 10 + (Asc(Left(Application.OperatingSystem, 1)) - 67) * 18
For I = 0 To 16
If I <= 12 Then R = R & Chr((d(I) + 100) / 2) _
Else E = E + Asc(d(I))
Next I
MsgBox R, (E - 40) / 4, ""
End Sub


Sub Serge()
D = Array(48, 122, 142, 102, 134, 140, -36, 56, 122, _
370, 116, -36, -34, "M", "P", "F", "E")
For I = 0 To 16
If I <= 12 Then R = R & Chr((D(I) + 100) / 2) _
Else E = E + Asc(D(I))
Next I
MsgBox R, (E - 40) / 4, ""
End Sub

;-)





--
Cordialement,

Michel Gaboly
www.gaboly.com