R
Robert
Tom
That's very kind of you. I'd like the whole lot at once so I can pick
over it.
Pushing my luck a bit (no, too much really) at your generosity, could
you post, separately, code that does NOT tackle the problem of letter
precedence? That is to say; combinations such as IV are NOT permitted
(this would be input as IIII).
I'd like to examine, if I could, such code too in order to see whether
I could adapt it to obey the principle of letter precedence.
Many domestic routines got in the way yesterday of my trying to code
the right solution to the problem of rejecting non-Roman characters
but a couple of hours of thinking (Why so long? A lot of mulling over
the manuals and the postings between keystrokes) produced this.
Private Sub TextBox1_textChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim b As Boolean = IsRomanNumeral(TextBox1.Text)
TextBox2.Text = b.ToString
End Sub
Private Function IsRomanNumeral(ByVal numeral As String) As
Boolean
Dim i As Integer
numeral = UCase(numeral)
For i = 0 To (numeral.Length - 1)
Select Case numeral.Substring(i, 1)
Case "M", "D", "C", "L", "X", "V", "I"
IsRomanNumeral = True
Case Else
IsRomanNumeral = False : TextBox1.Text = numeral
End Select
Next
End Function
Although it "works" returning TRUE or FALSE on cue I know that it's
defective and do not doubt your belief that I'm charging up the wrong
path anyway. However, I was pleased to have produced it nonetheless.
Even more thanks to you (and Fergus) for helping me with this.
In the glorious tradition of "a bad workman always blames his tools" I
can't let one more day go by without passing comment on computer
manuals in general. I've got 4 about visual basic, no less. All
written by enthusiasts, what computer manuals share in common is the
cheerfulness of the first chapter as you ponder their "Hello World!"
program -
"Congratulations! You've written your first program in Mugwump 6++",
giving way with all too cruel speed to something completely arcane.
"Polymorphism" makes its appearance in chapter 3 (!) in one book I've
got. On second thoughts, it could be, of course, that my learning
curve is far too flat these days...
Thanks to all who've helped so far.
Bob
That's very kind of you. I'd like the whole lot at once so I can pick
over it.
Pushing my luck a bit (no, too much really) at your generosity, could
you post, separately, code that does NOT tackle the problem of letter
precedence? That is to say; combinations such as IV are NOT permitted
(this would be input as IIII).
I'd like to examine, if I could, such code too in order to see whether
I could adapt it to obey the principle of letter precedence.
Many domestic routines got in the way yesterday of my trying to code
the right solution to the problem of rejecting non-Roman characters
but a couple of hours of thinking (Why so long? A lot of mulling over
the manuals and the postings between keystrokes) produced this.
Private Sub TextBox1_textChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim b As Boolean = IsRomanNumeral(TextBox1.Text)
TextBox2.Text = b.ToString
End Sub
Private Function IsRomanNumeral(ByVal numeral As String) As
Boolean
Dim i As Integer
numeral = UCase(numeral)
For i = 0 To (numeral.Length - 1)
Select Case numeral.Substring(i, 1)
Case "M", "D", "C", "L", "X", "V", "I"
IsRomanNumeral = True
Case Else
IsRomanNumeral = False : TextBox1.Text = numeral
End Select
Next
End Function
Although it "works" returning TRUE or FALSE on cue I know that it's
defective and do not doubt your belief that I'm charging up the wrong
path anyway. However, I was pleased to have produced it nonetheless.
Even more thanks to you (and Fergus) for helping me with this.
In the glorious tradition of "a bad workman always blames his tools" I
can't let one more day go by without passing comment on computer
manuals in general. I've got 4 about visual basic, no less. All
written by enthusiasts, what computer manuals share in common is the
cheerfulness of the first chapter as you ponder their "Hello World!"
program -
"Congratulations! You've written your first program in Mugwump 6++",
giving way with all too cruel speed to something completely arcane.
"Polymorphism" makes its appearance in chapter 3 (!) in one book I've
got. On second thoughts, it could be, of course, that my learning
curve is far too flat these days...
Thanks to all who've helped so far.
Bob