lotto_tom75
Advanced Premium Member
ho provato così grazie al suggerimento e code AI ...
ma mi da errore...
Codice:
Function AraboInRomano(numero)
Dim M = Array("", "M", "MM", "MMM")
Dim C = Array("", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM")
Dim X = Array("", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC")
Dim I = Array("", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX")
Dim migliaia, centinaia, decine, unita
migliaia = Int(numero / 1000)
centinaia = Int((numero Mod 1000) / 100)
decine = Int((numero Mod 100) / 10)
unita = numero Mod 10
AraboInRomano = M(migliaia) & C(centinaia) & X(decine) & I(unita)
End Function
Sub Main
Dim s 'As String
s = "05.30 r: BA p: 1.2.3.4.5 rap=rsp 243 num. inc 4 incmax att=sto 87 fqp 42 s 2; ?"
Dim start 'As Integer
start = InStr(s, "p:") + 2
Dim finish 'As Integer
finish = InStr(s, "rap")
Dim substring 'As String
substring = Mid(s, start, finish - start)
Dim numbers '() 'As String
numbers = Split(substring, ".")
Dim result 'As String
result = ""
For Each number In numbers
result = result & AraboInRomano(CInt(number)) & "."
Next
result = Left(result, Len(result) - 1) ' Rimuove l'ultimo punto
s = Replace(s, substring, result)
End Sub
ma mi da errore...