Sign in to follow this  
Followers 0
Terenz

Extract function from AU3

5 posts in this topic

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 :D


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

RegEx? I'll wait a guru for it...i can do only simply task with PCRE, not a things like that

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

#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")


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Work :D

Thanks boththose


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0