Rorax Posted October 12, 2006 Share Posted October 12, 2006 (edited) I want to do a search (know that part) that checks if the first letter of the filename is a letter (a,b, c) etc. And if it is a (1,2,3%,¤,",!,/ basically anything that isnt a letter) non-letter it will skip to the next letter in the filename and do it again. But I dont really know if there is a easy way to do it without using tons of IF's. Anyone have any good ideas? Regards, Rorax Edited October 12, 2006 by Rorax Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 12, 2006 Moderators Share Posted October 12, 2006 I want to do a search (know that part) that checks if the first letter of the filename is a letter (a,b, c) etc. And if it is a (1,2,3%,¤,",!,/ basically anything that isnt a letter) non-letter it will skip to the next letter in the filename and do it again. But I dont really know if there is a easy way to do it without using tons of IF's. Anyone have any good ideas? Regards, Rorax$sString = '1adf.txt' If StringIsAlpha(StringLeft($sString, 1)) Then MsgBox(64, 'Info', 'Chr is Not a Number') If StringIsDigit(StringLeft($sString, 1)) Then MsgBox(64, 'Info', 'Chr is a Number') $sString = 'adf.txt' If StringIsAlpha(StringLeft($sString, 1)) Then MsgBox(64, 'Info', 'Chr is Not a Number') If StringIsDigit(StringLeft($sString, 1)) Then MsgBox(64, 'Info', 'Chr is a Number') Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Rorax Posted October 12, 2006 Author Share Posted October 12, 2006 (edited) Thanks for the quick responce, I'll try it out right away. But if I get it correct it will check if its either a number or a letter. But what if its a character like %, ¤, (, ), [ or ]. Will it count as a letter or a number? edit: I searched the help file with the stringis that you used, and found StringIsASCII which shows special characters. Thanks again for your help Edited October 12, 2006 by Rorax Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now