Terenz Posted March 18, 2015 Share Posted March 18, 2015 Hi guys, Since i don't want to reinvent the wheel, i'm asking if is exist in Scite or some external example/UDF to extract a function from a script and paste it on another file. I need to get all the MsgBox from my long code and check if there are correct ( the code is multilinguage so i need to verify for every language if there is something wrong or misspelling ) The final code i'd like to have is like this: MsgBox(16, $aArray[1][$iLang], $aArray[2][$iLang]) ; there is a comment in my language for the original one MsgBox(16, $aArray[3][$iLang], $aArray[4][$iLang]) ; there is a comment in my language for the original one ;etc. Thaks for the help Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
JohnOne Posted March 18, 2015 Share Posted March 18, 2015 I think you might be looking at a rather complicated RegEx. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Terenz Posted March 18, 2015 Author Share Posted March 18, 2015 (edited) RegEx? I'll wait a guru for it...i can do only simply task with PCRE, not a things like that Edited March 18, 2015 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Solution iamtheky Posted March 18, 2015 Solution Share Posted March 18, 2015 #include <Array.au3> #include <File.au3> MsgBox(0, '' , 'msgbox 1') ; there is a comment in my language for the original one MsgBox(0, '' , 'msgbox 2') ; there is a comment in my language for the original one ;MsgBox(0, '' , 'msgbox commented should not be captured') MsgBox(0, '' , 'msgbox 3') ; there is a comment in my language for the original one $aThisFile = FileReadToArray(@ScriptFullPath) Global $aMsgBoxes[0] For $i = 0 to ubound($aThisFile) - 1 If stringleft(stringstripws($aThisFile[$i] , 8) , 6) = "MsgBox" Then _ArrayAdd($aMsgBoxes , $aThisFile[$i]) Next _FileWriteFromArray(@ScriptDir & "\output_msgboxes.au3" , $aMsgBoxes) ShellExecute(@ScriptDir & "\output_msgboxes.au3") ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Terenz Posted March 18, 2015 Author Share Posted March 18, 2015 Work Thanks boththose Nothing is so strong as gentleness. Nothing is so gentle as real strength 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