kpu Posted November 30, 2005 Share Posted November 30, 2005 I'm having issues sending text to an input box in uppercase. Even if the text is in uppercase, it changes it to lower case... I'm sure I'm just missing something small.. but any help would greatly be appreciated. Here's my code. You need a Text File called "temp.txt" with Four lines in it: expandcollapse popup; Script generated by FormDesigner Preview 1 (very alpha state, use at your own risk) #include <GuiConstants.au3> Dim $temp, $file, $replace, $line ;----------------------------------------------------------------------------------------------- AutoItSetOption("TrayIconHide", 1) ;----------------------------------------------------------------------------------------------- $script_title = "Gui app" GuiCreate($script_title, 266, 120, 430,346) GUISetFont(12, 400, "", "Arial") $txt_pcname = GuiCtrlCreateInput("Text here", 8, 32, 249, 29) GUICtrlSetLimit(-1, 14) $btn_findit = GuiCtrlCreateButton("Find It", 56, 64, 97, 25) ;----------------------------------------------------------------------------------------------- GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $btn_findit GUICtrlSetState($btn_findit, $GUI_DISABLE) $ws = GUICtrlRead($txt_pcname) $temp = "temp.txt" $file = FileOpen($temp, 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open " & $temp) Exit EndIf $line = FileReadLine($file, 1) SplashOff() If $line = "Nothing Found" Then MsgBox(16, "Warning!", $line) Else $line = FileReadLine($file, 4) $line = StringUpper($line) ClipPut($line) MsgBox(32,"",$line) MsgBox(32,"","found the following information:" & @CRLF & $line) GUICtrlSetState($btn_findit, $GUI_ENABLE) ;-->moved upClipPut($line) FileClose($file) WinSetState($script_title, "", @SW_SHOW) ControlSend($script_title, "", "Edit1", ClipGet()) EndIf ;--------------------------------------------------------------------------------------- Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit ;----------------------------------------------------------------------------------------------- http://www.kpunderground.com Link to comment Share on other sites More sharing options...
GaryFrost Posted November 30, 2005 Share Posted November 30, 2005 Why use controlsend instead of GuiCtrlSetdata? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted November 30, 2005 Share Posted November 30, 2005 (edited) i cant test it ... but maybe this will work?? MsgBox(32,"","found the following information:" & @CRLF & (StringUpper($line))) and ControlSend($script_title, "", "Edit1", (StringUpper(ClipGet()))) good luck 8) i also noticed what gafrost said Edited November 30, 2005 by Valuater Link to comment Share on other sites More sharing options...
kpu Posted November 30, 2005 Author Share Posted November 30, 2005 Why use controlsend instead of GuiCtrlSetdata? I am using controlsend. One line up from the "EndIF" ControlSend($script_title, "", "Edit1", ClipGet()) Valuater, I'm trying your solution now. Thanks to both of you for the quick response! http://www.kpunderground.com Link to comment Share on other sites More sharing options...
kpu Posted November 30, 2005 Author Share Posted November 30, 2005 Sorry Guys, It's still doing the same thing. http://www.kpunderground.com Link to comment Share on other sites More sharing options...
Valuater Posted November 30, 2005 Share Posted November 30, 2005 this worked expandcollapse popup;Script generated by FormDesigner Preview 1 (very alpha state, use at your own risk) #include <GuiConstants.au3> Dim $temp, $replace, $line ;----------------------------------------------------------------------------------------------- AutoItSetOption("TrayIconHide", 1) ;----------------------------------------------------------------------------------------------- $script_title = "Gui app" GuiCreate($script_title, 266, 120, 430,346) GUISetFont(12, 400, "", "Arial") $txt_pcname = GuiCtrlCreateInput("Text here", 8, 32, 249, 29) GUICtrlSetLimit(-1, 14) $btn_findit = GuiCtrlCreateButton("Find It", 56, 64, 97, 25) ;----------------------------------------------------------------------------------------------- GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $btn_findit GUICtrlSetState($btn_findit, $GUI_DISABLE) $ws = GUICtrlRead($txt_pcname) $temp = @ScriptDir & "\test.txt"; i changed this $file = FileOpen($temp, 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open " & $temp) Exit EndIf $line = FileReadLine($file, 1) If $line = "Nothing Found" Then MsgBox(16, "Warning!", $line) Else $line = FileReadLine($file, 4) $line = StringUpper($line) ClipPut($line) MsgBox(32,"",$line) MsgBox(32,"","found the following information:" & @CRLF & (StringUpper($line))) GUICtrlSetState($btn_findit, $GUI_ENABLE) ;-->moved upClipPut($line) FileClose($file) WinSetState($script_title, "", @SW_SHOW) GUICtrlSetData( $txt_pcname, (StringUpper(ClipGet()))) ;ControlSend($script_title, "", "Edit1", (StringUpper(ClipGet()))) EndIf ;--------------------------------------------------------------------------------------- Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit ;----------------------------------------------------------------------------------------------- 8) Link to comment Share on other sites More sharing options...
kpu Posted November 30, 2005 Author Share Posted November 30, 2005 I am using controlsend. One line up from the "EndIF" Edit: Opps.. I read it wrong. Sorry Gafost! :"> ControlSend($script_title, "", "Edit1", ClipGet()) Valuater, I'm trying your solution now. Thanks to both of you for the quick response! http://www.kpunderground.com Link to comment Share on other sites More sharing options...
kpu Posted November 30, 2005 Author Share Posted November 30, 2005 Thanks Guys. http://www.kpunderground.com Link to comment Share on other sites More sharing options...
Valuater Posted November 30, 2005 Share Posted November 30, 2005 Cool... 8) 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