Code : Tout sélectionner
;*******************************************************************************************
Procedure Roman2Dec(R.S)
   Protected.S RP0 = "CM,M,CD,D,XC,C,XL,L,IX,X,IV,V,I", RP
   Repeat
      For J = 1 To 13
         RP = StringField(RP0, J, ",")
         If Right(Ucase(R), Len(RP) ) = RP
            N + Val(StringField("900,1000,400,500,90,100,40,50,9,10,4,5,1", J, ",") )
            R = Left(R, Len(R) - Len(RP) )
         EndIf
      Next
   Until R = ""
   ProcedureReturn N
EndProcedure

