lordicast Posted November 27, 2007 Share Posted November 27, 2007 (edited) hey guys is there anyway of banning a word like a censor from a specific Input $txt = GUICtrlCreateInput("", 64, 232, 185, 21) if GUICtrlRead($txt) = 'hello' Then suit() Else Msgbox(0,'title,''$txt'') EndIf I get it to work for just saying "hello" however function wont work with sentences like "hello my name is" or "oh hello by the way" thanks Edited November 27, 2007 by lordicast [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
MerkurAlex Posted November 27, 2007 Share Posted November 27, 2007 hey guys is there anyway of banning a word like a censor from a specific Input$txt = GUICtrlCreateInput("", 64, 232, 185, 21)if GUICtrlRead($txt) = 'hello' Then suit() Else Msgbox(0,'title,''$txt'') EndIfI get it to work for just saying "hello" however function wont work with sentences like "hello my name is" or "oh hello by the way"thanksLook at stringreplace in the help file. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
JustinReno Posted November 27, 2007 Share Posted November 27, 2007 I learned something new. Anyways, look of this example I made: $GUI = GUICreate("GUI", 123, 22, 193, 115) $Input = GUICtrlCreateInput("", 0, 0, 121, 21) GUISetState(@SW_SHOW) While 1 $Read = GUICtrlRead($Input) $StringReplace = StringReplace($Read, "boob", "breast") GuiCtrlSetData($Input, $StringReplace) $Msg = GUIGetMsg() Switch $Msg Case -3 Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
Achilles Posted November 27, 2007 Share Posted November 27, 2007 If you want a more efficient (and more complicated) way then Justin's then use GuiRegisterMsg(). This would allow you to be notified every time the text is changed. However, if this is just a small script I would recommend staying with the simple solution. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
lordicast Posted November 27, 2007 Author Share Posted November 27, 2007 that may be what I need piano im trying to call a function when any part of that string hits. thanks justin and eagle both suggestions work for different instances solved 2 problems [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
JustinReno Posted November 27, 2007 Share Posted November 27, 2007 Your welcome. 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