MyEarth Posted October 21, 2014 Posted October 21, 2014 (edited) Hello, I want to allow a character, like !, only is in the first position of the input like: !abc The problems is how...If i use StringLeft($Input, 1 ) work only if the string is empty because if i have: abc And i move the caret at the first position, like. |abc And i try to write not work bacuse the StringLeft($Input, 1) = c I have think something like the char at the left of the caret but i don't know if possible. Any suggestion are welcome. Thank you EDIT: Or maybe some RegExp for check if ! is the first character, if not replace it with "" Edited October 21, 2014 by MyEarth
Solution funkey Posted October 21, 2014 Solution Posted October 21, 2014 #include "RestrictControlRegExp.au3" Opt("GUIOnEventMode", 1) _RegEx_RestrictControl_setup (20) ; prepare for up to 20 Controls to restrict GUICreate("Test") GUISetOnEvent(-3, "_quit") $inp = GUICtrlCreateInput("", 10, 200, 100, 20) _RegEx_RestrictControl_add ($inp, "\A[!]", "!abc") GUISetState() While 1 Sleep(10) WEnd Func _quit() Exit EndFunc ;==>_quit '?do=embed' frameborder='0' data-embedContent>> Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
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