I have encountered a block in my programming escapade. The project that I am working on is from a visual basic 6.0 programming book and is a program that opens a data file filled with roman numerals, read to end of file, and outputs the numerals digit form, performs a mathematical operator on them, and then display output. I am also employing the use of subfunctions/subroutines to better organize my program. Below are my subs.

ReadRoman - Reads a string which represents a Roman Number, calls GetDigit to convert this Roman Digit into a decimal number, adds this decimal number to the value of the roman number.

GetDigit = Takes a roman digit and returns the decimal value to the caller.

Calculate - Takes the decimal equivalent of both Roman numbers and the operator and computes their combined result. Uses WriteRoman to display the last line of output.

WriteRoman - Takes a decimal number and converts it into a Roman Nubmer. Calls Writedigit in order to accomplish the above.

WriteDigit - Print a Roman Digit

To better explain it, I have included the data file as well as a little preview of what I would like to output.

Output

The First Numer is 1226
The second number is 68
The Operation is +
MCCXXVI + LXVIII = MCCLXXXXIIII (1294)

Dim numerals As String
Private Function ReadRoman()
End Function
Private Function GetDigit(ByVal Num As String) As Integer
Select Case Num
Case "I"
GetDigit = 1
Case "V"
GetDigit = 5
Case "X"
GetDigit = 10
Case "L"
GetDigit = 50
Case "C"
GetDigit = 100
Case "D"
GetDigit = 500
Case "M"
GetDigit = 1000
End Select
End Function
Private Function WriteRoman()
Call WriteDigit
output.Print Number
End Function
Private Function WriteDigit()
output.Print numerals
End Function
Private Sub calculate_Click()
Input #1, numerals
For i = 1 To Len(numerals)
End Sub
Private Sub Form_Load()
'open file
Open App.Path & "\numerals.dat" For Input As #1
'Do While Not EOF(1)
End Sub

Thank you for your time, and I apologize for any grammatical errors and lack of programming experience.

It is unfortunately a tad more difficult than that. The problem you have now is that you have to literally check each character on input to determine some sort of macth to your Roman numerals. You would have to put the roman numerals inside arrays then loop through them. As in the attached example.

I did not make this app, so I cannot and will not take credit for it. If you were to search on CG you will find it