Edifice Posted February 16, 2009 Share Posted February 16, 2009 (edited) Hello You properly get my drift... Func checkphonenumber() If GUIctrlRead($input_tlfnr, 1) > 99999999 And < 120 Then MsgBox(0, "Fejl", "Telefonnummeret er ikke indtastet korrekt! Venligst udfyld telefonnummeret") runprogram() EndIf EndFunc I wan't to exe the msgbox only if the value is not between 120 and 99999999, however it's letting me do that, and I can't really find any subjects about logical comparison - so, here I am. Again, I really value the help I get from you guys! Edited February 16, 2009 by Edifice Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 Okay you're not evaluating the expression twice. You're simply doing it once, but I see what you're trying to accomplish. Lets see if the below helps you out...Func checkphonenumber() If GUICtrlRead($input_tlfnr, 1) > 99999999 AND GUICtrlRead($input_tlfnr, 1) < 120 Then MsgBox(0, "Fejl", "Telefonnummeret er ikke indtastet korrekt! Venligst udfyld telefonnummeret") runprogram() EndIf EndFuncI hope that helps,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
exodius Posted February 16, 2009 Share Posted February 16, 2009 I'm not sure what the phone number format is where you live, but I would think you could use StringRegExp to get a more precise check on whether they entered a valid phone number or not. Check it out! Link to comment Share on other sites More sharing options...
Edifice Posted February 16, 2009 Author Share Posted February 16, 2009 Okay you're not evaluating the expression twice. You're simply doing it once, but I see what you're trying to accomplish. Lets see if the below helps you out...Func checkphonenumber() If GUICtrlRead($input_tlfnr, 1) > 99999999 AND GUICtrlRead($input_tlfnr, 1) < 120 Then MsgBox(0, "Fejl", "Telefonnummeret er ikke indtastet korrekt! Venligst udfyld telefonnummeret") runprogram() EndIf EndFunc I hope that helps, Jarvis Well you'd think so but now the MsgBox doesn't show at all. I guess that statement is never true - how ever that's possible?! Link to comment Share on other sites More sharing options...
exodius Posted February 16, 2009 Share Posted February 16, 2009 Well you'd think so but now the MsgBox doesn't show at all. I guess that statement is never true - how ever that's possible?!Well, in the first place, you don't need to set the flag for extended information on your GuiCtrlRead to 1:GUICtrlRead($input_tlfnr, 1)should probably beGUICtrlRead($input_tlfnr)In the second place, what is the format of phone numbers where you're at? Link to comment Share on other sites More sharing options...
Edifice Posted February 16, 2009 Author Share Posted February 16, 2009 (edited) I'm not sure what the phone number format is where you live, but I would think you could use StringRegExp to get a more precise check on whether they entered a valid phone number or not. Check it out! Isn't StringRegExp just "Match or not"? - Coz I don't want to type all possible phonenumbers :SBtw, the possible phonenumbers range from about 120 to about 99999999 - no letters, nothing fancy Edited February 16, 2009 by Edifice Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 Well, in the first place, you don't need to set the flag for extended information on your GuiCtrlRead to 1:GUICtrlRead($input_tlfnr, 1)should probably beGUICtrlRead($input_tlfnr)In the second place, what is the format of phone numbers where you're at?Exodius,Thanks for pointing that out for the extended data. I believe that returns an array which is amazing that it ever showed the text box before.Judging from the text he has entered he's from Norway, and the following has a link to acceptable phone number formats. I have written a few Regular Expressions to accept phone numbers from around the world so that's why I looked this up. I cannot find my libraries at the moment or I would post the code here for the Regular Expression of Norway. I am sure a google would return it.http://en.wikipedia.org/wiki/Telephone_numbers_in_NorwayThanks,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
exodius Posted February 16, 2009 Share Posted February 16, 2009 Exodius,Thanks for pointing that out for the extended data. I believe that returns an array which is amazing that it ever showed the text box before.Judging from the text he has entered he's from Norway, and the following has a link to acceptable phone number formats. I have written a few Regular Expressions to accept phone numbers from around the world so that's why I looked this up. I cannot find my libraries at the moment or I would post the code here for the Regular Expression of Norway. I am sure a google would return it.http://en.wikipedia.org/wiki/Telephone_numbers_in_NorwayThanks,JarvisWowsers, that's a little different than here in the States! So since you have such Regular Expressions already in existence somewhere, should we wait for you to find them? Link to comment Share on other sites More sharing options...
trancexx Posted February 16, 2009 Share Posted February 16, 2009 Well you'd think so but now the MsgBox doesn't show at all. I guess that statement is never true - how ever that's possible?!It would be kind of miracle to get msgbox out of there, ever. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Edifice Posted February 16, 2009 Author Share Posted February 16, 2009 Well Actually I'm from denmark - But very nicely guessed http://en.wikipedia.org/wiki/Telephone_numbers_in_DenmarkActually, I just looked up GUICtrlRead(), and the flag for inputboxes makes no difference according to the helpfile.Tried to change it but without luck. Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 Below is the Regular Expression I used for "International Numbers" I am not certain it includes everyone, but it certainly covers the area that I could find information on that seemed to be solid information.$pattern = '/^(?:[+]\d{1,3}(?:[-\.\s]{1}))?(?:\(\d{1}\)(?:[-\.\s]{1}))?(?:(?:\(\d{1,6}\))|(?:\d{1,6}))(?:[-\.\s]{1})\d{2,4}(?:[-\.\s]{1})\d{4}$/';I hope that helps if you're going to use StringRegExp(),Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Edifice Posted February 16, 2009 Author Share Posted February 16, 2009 It would be kind of miracle to get msgbox out of there, ever. You are correct! Thanks for pointing my attention to that small word AND - It's supposed to be Or Func checkphonenumber() If GUICtrlRead($input_tlfnr) > 99999999 Or GUICtrlRead($input_tlfnr) < 120 Then MsgBox(0, "Fejl", "Telefonnummeret er ikke indtastet korrekt! Venligst udfyld telefonnummeret") runprogram() EndIf EndFunc Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 Well Actually I'm from denmark - But very nicely guessed http://en.wikipedia.org/wiki/Telephone_numbers_in_DenmarkActually, I just looked up GUICtrlRead(), and the flag for inputboxes makes no difference according to the helpfile.Tried to change it but without luck.I tried...are the languages similar in Denmark and Norway?Thanks,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 You are correct! Thanks for pointing my attention to that small word AND - It's supposed to be Or Func checkphonenumber() If GUICtrlRead($input_tlfnr) > 99999999 Or GUICtrlRead($input_tlfnr) < 120 Then MsgBox(0, "Fejl", "Telefonnummeret er ikke indtastet korrekt! Venligst udfyld telefonnummeret") runprogram() EndIf EndFuncDoh! Can't believe I missed that myself when I re-worded the And to AND Thanks, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Edifice Posted February 16, 2009 Author Share Posted February 16, 2009 I tried...are the languages similar in Denmark and Norway?Thanks,JarvisVery much so - The pronouncement is a bit different but the writing are almost similar. It's properly because Denmark And Norway were one country untill not more than a couple of hundred years ago Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 16, 2009 Share Posted February 16, 2009 Very much so - The pronouncement is a bit different but the writing are almost similar. It's properly because Denmark And Norway were one country untill not more than a couple of hundred years ago Ah okay. So it would be similar to English in different parts of the world. Pronunciations (Accents) are most different. Some have different spellings.Glad you got it figured out. If you get brave you can try that Regular Expression...I would be pleased to know if it works for Denmark...Thanks,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) 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