SonicBoomAu Posted November 26, 2004 Posted November 26, 2004 Is there an easy way of checking to see if a value is between a certain range. For Example, I want to see if a value is between "A" and "Z". The only way I can think of is to individually check every letter(if strAlpha = "A" then......). Where as what I would like to do is if strAlpha =< "A" or strAlpha => "Z". Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
ThePentiumGuy Posted November 26, 2004 Posted November 26, 2004 Convert each thing to ASCII (I beleive 65 is 'A' and 91 is 'Z') and see if the value's in between. Google around for an ASCII key table :D Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
HJB417 Posted November 26, 2004 Posted November 26, 2004 or a regex but ThePentiumGuy's method is better in this scenario. Quote
SonicBoomAu Posted November 26, 2004 Author Posted November 26, 2004 Thank You Thank you that worked. If strThirdAlpha >= Chr(65) And strThirdAlpha <= Chr(90) Then I didn't have to convert the original string which is handy. :D ACSII table: http://www.asciitable.com/ Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.