Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 09-19-2012, 11:04 AM   #1
In Runtime
Join Date: Apr 2012
Location: Canada
Posts: 322

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


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

Edsterr is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 12:36 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0