-
Posts
2,658 -
Joined
-
Last visited
-
Days Won
19
Everything posted by FrancescoDiMuro
-
Repeating Regex Pattern
FrancescoDiMuro replied to InclusiveExclusion's topic in AutoIt General Help and Support
@seadoggie01 Thanks! Now I know who to call when we need to chase flavoured cats -
merging duplicated data
FrancescoDiMuro replied to Shark007's topic in AutoIt General Help and Support
@Shark007 Glad I could help -
merging duplicated data
FrancescoDiMuro replied to Shark007's topic in AutoIt General Help and Support
@Shark007 Use an array to store the names, and use a "global" function to call all the other functions in a loop (untested): ; Call the function once General() Func General() Local $arrNames[] = ["Brenda", "Jim", "Frank", "Karen", "Steve"], _ $strName ; Iterate through the names For $strName in $arrNames ; Calls the functions here unlock($strName) kind($strName) Next EndFunc -
Repeating Regex Pattern
FrancescoDiMuro replied to InclusiveExclusion's topic in AutoIt General Help and Support
@Nine Nice idea, but what do you think about this one? Here @mikell, *smooch smooch smooch* -
Repeating Regex Pattern
FrancescoDiMuro replied to InclusiveExclusion's topic in AutoIt General Help and Support
I knew I should have bring a dog here -
Repeating Regex Pattern
FrancescoDiMuro replied to InclusiveExclusion's topic in AutoIt General Help and Support
@Nine Use + instead of * in the capturing group, otherwise the function returns even the last blank line -
Repeating Regex Pattern
FrancescoDiMuro replied to InclusiveExclusion's topic in AutoIt General Help and Support
@InclusiveExclusion Since you are using a global match ($STR_REGEXPARRAYGLOBALMATCH = 3), your pattern is searched for the whole file, and so, it would work even without the {1}. Look at this example: #include <Array.au3> #include <StringConstants.au3> Test() Func Test() Local $strFileName = @ScriptDir & "\Versions.log", _ $strFileContent, _ $arrResult $strFileContent = FileRead($strFileName) If @error Then Return ConsoleWrite("FileRead ERR: " & @error & @CRLF) $arrResult = StringRegExp($strFileContent, '(?m)^\s*([^\r\n]+)\s*$', $STR_REGEXPARRAYGLOBALMATCH) If IsArray($arrResult) Then _ArrayDisplay($arrResult) EndFunc Splitting the pattern, you have this: ^ asserts position at start of a line \s matches any whitespace character (equivalent to [\r\n\t\f\v ]) * matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy) 1st Capturing Group ([^\r\n]) Match a single character not present in the list below [^\r\n] + matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy) \r matches a carriage return (ASCII 13) \n matches a line-feed (newline) character (ASCII 10) \s matches any whitespace character (equivalent to [\r\n\t\f\v ]) * matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy) $ asserts position at the end of a line Global pattern flags (?m) modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) And, since the function SRE is using $STR_REGEXPARRAYGLOBALMATCH here too, then the pattern is applied globally to the string, so, no matter how many lines you do have in the file, as long as the pattern is verified, it is returned by the SRE function. By the way, use this website to check out what's going on with your patterns -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
Did you find anything useful in it? Maybe this couls help? -
Problem with the Open-Delete-ReCreate Pattern
FrancescoDiMuro replied to dogisay's topic in AutoIt General Help and Support
Hi @dogisay, and to the AutoIt forum. Could you please post a runnable script, so we can try to assist you? -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
@Earthshine Nice profile picture -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
@jaja714 I've never used OracleDB, so I can't say what is wrong there but, have you checked this? -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
@jaja714 If you have any problem, don't be afraid to post a runnable script, so we can assist you more Good luck! EDIT: In fact, there are no examples with Oracle DB in the ADO Wiki section -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
@jaja714 Just look for them -
Oracle SQL db queries
FrancescoDiMuro replied to JeffAllenNJ's topic in AutoIt General Help and Support
@jaja714 Just an overview of what you can do with ADO and AutoIt -
receive informetion from telegram messsage
FrancescoDiMuro replied to CraZyNes's topic in AutoIt General Help and Support
@CraZyNes You should post the script -
_Excel_RangeFind in a specific sheet
FrancescoDiMuro replied to kawumm3000's topic in AutoIt General Help and Support
@kawumm3000 You could use Worksheets collection to search in a specific sheet: #include <Array.au3> #include <Excel.au3> Test() Func Test() Local $strFileName = @ScriptDir & "\Test.xlsx", _ $objExcel, _ $objWorkbook, _ $arrResult $objExcel = _Excel_Open() If @error Then Return ConsoleWrite("_Excel_Open ERR: " & @error & @CRLF) $objWorkbook = _Excel_BookOpen($objExcel, $strFileName) If @error Then Return ConsoleWrite("_Excel_BookOpen ERR: " & @error & @CRLF) ; Use $objWorkbook.Worksheets(SheetNumber).UsedRange or $objWorkbook.Worksheets(SheetName).UsedRange $arrResult = _Excel_RangeFind($objWorkbook, "TextToFind", $objWorkbook.Worksheets(1).UsedRange) If @error Then Return ConsoleWrite("_Excel_RangeFind ERR: " & @error & @CRLF) If UBound($arrResult) > 0 Then _ArrayDisplay($arrResult) _Excel_BookClose($objWorkbook) _Excel_Close($objExcel) EndFunc @Nine -
How to best obtain the current two digit year?
FrancescoDiMuro replied to cag8f's topic in AutoIt General Help and Support
@cag8f ConsoleWrite("Two Digits Year: " & _TwoDigitsYear() & @CRLF) Func _TwoDigitsYear() Return StringRight(@YEAR, 2) EndFunc -
@USSSR As you can see, the Window's class is "WorkerW", so you could take the handle of this window using WinGetHandle() and the Class of the window. Having the handle of the window, you could take the handle of the ListView control always using the class name with ControlGetHandle(). Once you have these handles, you could use _GUICtrlListView_* to get what you need (in this case, the text of an item). But, as you can see from here, there are plenty functions to be used with ListView (all those which start with _GUICtrlListView_), and so, you can try to use those to get some information from the ListView handle previousely taken
-
@rotac Don't worry. That function is so powerful, but needs a bit of knowledge before digging into it. Here's something that might help you: #include <StringConstants.au3> Test() Func Test() Local $arrTimes[6] = ['23:59', '15:20', '01:72', '14:32', '00:00', '41:59'] For $i = 0 To UBound($arrTimes) - 1 Step 1 ConsoleWrite("Is a correct time " & $arrTimes[$i] & "? " & (_IsTime($arrTimes[$i]) ? "Yes" : "No") & @CRLF) Next EndFunc Func _IsTime($strUserInput) Return StringRegExp($strUserInput, '^[0-2][0-9]:[0-5][0-9]$', $STR_REGEXPMATCH) EndFunc Just use the function _IsTime() when you read the content of the input control, passing what you've read from that control, and checking that the return value is 1
-
@rotac There are a couple ways to make this work: Use a Date Time Picker control instead of a Text Input control with the Control Style $DTS_TIMEFORMAT; Use StringRegExp() to ensure that the user is inserting exactly a time format string, and nothing else. Which one do you like the most?
-
Hi @rotac, and to the AutoIt forum! Could you please post the entire script?