VB 2005 EE Question

Edsterr

In Runtime
Messages
322
Location
Canada
I'm using VB 2005 Express Edition in school at the moment and I've just got a quick question.
What coding would be required to check that all characters in a string of 10 letters were between a-f.
For example, if I were to input 'srgbjduftr' then a message box would come up saying that there is an error, whereas the string 'abcdefabcd' would work fine.

Coding I've got so far:


Dim TestRun(3) as String
Dim Counter as Integer


For Counter = 1 to 3

Do

TestRun(Counter) = InputBox("Please enter a 10 letter string")

If Len(TestRun(Counter)) > 10 or < 10 Then

MsgBox("Invalid String, Must only contain 10 characters")

End if

Loop until Len(TestRun(Counter)) = 10

Next
 
Back
Top Bottom