eltorro Posted June 7, 2006 Share Posted June 7, 2006 I have several statement like GuiCtrlSetState($SomeControl,$GUI_HIDE)oÝ÷ Û^ç(èqÍ4ÓK)j{-ÊWoÝ÷ Ùú+{¦¦W©àx-+ºÚ"µÍØÙHBÚ[Ù]]H Ú[Ù]]J ][ÝÉ][ÝÊK ][ÝÉ][ÝË ÌÍÜÕ]JBÕRPÝÙ]]J ÌÍÓX[Ì×K ÌÍÜÕ]JBÊÚÝÈÛÛÛÈ ÕRPÝÙ]Ý]J ÌÍÔXÖÌK ÌÍÑÕRWÔÒÕÊBÕRPÝÙ]Ý]J ÌÍÔXÖÌ×K ÌÍÑÕRWÔÒÕÊBÕRPÝÙ]Ý]J ÌÍÓX[ÌK ÌÍÑÕRWÔÒÕÊBÕRPÝÙ]Ý]J ÌÍÓX[Ì×K ÌÍÑÕRWÔÒÕÊBÕRPÝÙ]Ý]J ÌÍÑÜXÖÌWK ÌÍÑÕRWÔÒÕÊBÐÛÛ[[Û]ÛÊ ÌÍÚS[Ù BÊYHÛÛÛÈ ÕRPÝÙ]Ý]J ÌÍÔXÖÌWK ÌÍÑÕRWÒQJBÝZPÝÙ]Ý]J ÌÍÓX[ÌK ÌÍÑÕRWÒQJBÝZPÝÙ]Ý]J ÌÍÓX[ÍK ÌÍÑÕRWÒQJBoÝ÷ ÚÚºÚ"µÍØÙHBÚ[Ù]]H Ú[Ù]]J ][ÝÉ][ÝÊK ][ÝÉ][ÝË ÌÍÜÕ]JBÕRPÝÙ]]J ÌÍÓX[Ì×K ÌÍÜÕ]JBÊÚÝÈÛÛÛÈ ÐÝÚÝÊ ÌÍÔXÖÌJBÐÝÚÝÊ ÌÍÔXÖÌ×JBÐÝÚÝÊ ÌÍÓX[ÌJBÐÝÚÝÊ ÌÍÓX[Ì×JBÐÝÚÝÊ ÌÍÑÜXÖÌWJBÐÛÛ[[Û]ÛÊ ÌÍÚS[Ù BÊYHÛÛÛÈ ÐÝYJ ÌÍÔXÖÌWJBÐÝYJ ÌÍÓX[ÌJBÐÝYJ ÌÍÓX[ÍJBBasically, the regular expression needs to find "GuiCtrlSetState(" and ",$GUI_HIDE)" and replace it with "_CtrlHide(" and ")" leaving the $SomeControl alone. Can the regex feature of search and replace in scite accomplish this?? An example would be greatly appreciated.In this is not possible within scite, can a lua scipt accomplish the task?elTorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
CyberSlug Posted June 7, 2006 Share Posted June 7, 2006 I'm feeling lazy... so no thinking about RegExp and IO. Copy your code to the clipboard, then run the following script. Output will be in clipboard. Dim $text = StringSplit( ClipGet(), @LF) Dim $line, $new Dim $output = "" For $i = 1 to $text[0] $line = $text[$i] $new = $line If StringInStr($line, "GuiCtrlSetState") And StringInStr($line, "$GUI_SHOW") Then $new = StringReplace($new, "GuiCtrlSetState", "_CtrlShow") $new = StringReplace($new, ",$GUI_SHOW)", ")") ElseIf StringInStr($line, "GuiCtrlSetState") And StringInStr($line, "$GUI_HIDE") Then $new = StringReplace($new, "GuiCtrlSetState", "_CtrlHide") $new = StringReplace($new, ",$GUI_HIDE)", ")") EndIf $output = $output & $new & @LF Next ClipPut($output) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
eltorro Posted June 7, 2006 Author Share Posted June 7, 2006 I'm feeling lazy... so no thinking about RegExp and IO. Copy your code to the clipboard, then run the following script. Output will be in clipboard. Dim $text = StringSplit( ClipGet(), @LF) Dim $line, $new Dim $output = "" For $i = 1 to $text[0] $line = $text[$i] $new = $line If StringInStr($line, "GuiCtrlSetState") And StringInStr($line, "$GUI_SHOW") Then $new = StringReplace($new, "GuiCtrlSetState", "_CtrlShow") $new = StringReplace($new, ",$GUI_SHOW)", ")") ElseIf StringInStr($line, "GuiCtrlSetState") And StringInStr($line, "$GUI_HIDE") Then $new = StringReplace($new, "GuiCtrlSetState", "_CtrlHide") $new = StringReplace($new, ",$GUI_HIDE)", ")") EndIf $output = $output & $new & @LF Next ClipPut($output) Thanks CyberSlug! Worked slicker than Owl doo on a tree limb. Hey wait a min, I coulda done that ...... If I'd thought of it dur duh doh Good ole string functions. @Anyone: I would still be good to know if and how it can be done in scite though. Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 7, 2006 Share Posted June 7, 2006 HI, two replaces. CTRL+H 1. GUICtrlSetState --> _CtrlHide 2. ,$GUI_HIDE --> "" So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
CyberSlug Posted June 7, 2006 Share Posted June 7, 2006 two replaces. CTRL+H1. GUICtrlSetState --> _CtrlHide2. ,$GUI_HIDE --> ""You might need to look again at the example Some of the GUICtrlSetState's are $GUI_SHOW Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Developers Jos Posted June 8, 2006 Developers Share Posted June 8, 2006 (edited) Try this in SciTE:1. Open Replace window2. Tick Regular expression3. type in "Find what": GuiCtrlSetState(\([a-z0-9$_/[/]]+\),$GUI_HIDE)4. type in "Replace with": _CtrlHide(\1)5. click "Replace All" Edited June 8, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 8, 2006 Share Posted June 8, 2006 You might need to look again at the example Some of the GUICtrlSetState's are $GUI_SHOWOh sorry, missed that. But it should be done with 4 replaces. Which would be faster in this case, than thinking about the reg definition. (for me :"> )So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
eltorro Posted June 8, 2006 Author Share Posted June 8, 2006 Oh sorry, missed that. But it should be done with 4 replaces. Which would be faster in this case, than thinking about the reg definition. (for me : )So long,MegaI don't see how 4 replaces would work as in when you change GuiCtrlSetState.....I fairly certain that regex in SciTE 's search and replace will not do the job either.I don't make changes in scripts like this often, but sometimes it is handy. An external script may be better suited for such a task.elTorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
CyberSlug Posted June 8, 2006 Share Posted June 8, 2006 JdeB has the right idea, but I had to modify the regexp to get it to work: First replacement: GuiCtrlSetState(\([a-z0-9$_].*\),$GUI_HIDE) _CtrlHide(\1) Second replacement: GuiCtrlSetState(\([a-z0-9$_].*\),$GUI_SHOW) _CtrlShow(\1) *This Should work* Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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