BCX Console Demonstration Program S64.bas

 DIM value
 
 DIM result$
 
 value = VAL(COMMAND$)
 
 ? "Convert an integer to Roman Numeral"
 
 IF value = 0 THEN
   INPUT "Enter an integer value: ", value
 END IF
 
 PRINT value, " = ";
 
 WHILE value >= 1000
   value = value - 1000
   result$ = result$ & "M"
 WEND
 
 WHILE value >= 900
   result$ = result$ & "CM"
   value = value - 900
 WEND
 
 WHILE value >= 500
   result$ = result$ & "D"
   value = value - 500
 WEND
 
 WHILE value >= 400
   result$ = result$ & "CD"
   value = value - 400
 WEND
 
 WHILE  value >= 100
   result$ = result$ & "C"
   value = value - 100
 WEND
 
 WHILE value >= 90
   result$ = result$ & "XC"
   value = value - 90
 WEND
 
 WHILE value >= 50
   result$ = result$ & "L"
   value = value - 50
 WEND
 
 WHILE value >= 40
   result$ = result$ & "XL"
   value = value - 40
 WEND
 
 WHILE value >= 10
   result$ = result$ & "X"
   value = value - 10
 WEND
 
 WHILE value >= 9
   result$ = result$ & "IX"
   value = value - 9
 WEND
 
 WHILE value >= 5
   result$ = result$ & "V"
   value = value - 5
 WEND
 
 WHILE value >= 4
   result$ = result$ & "IV"
   value = value - 4
 WEND
 
 WHILE value >= 1
   result$ = result$ & "I"
   value = value - 1
 WEND
 
 PRINT result$