Jump to content

FrancescoDiMuro

Active Members
  • Posts

    2,658
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by FrancescoDiMuro

  1. @seadoggie01 Thanks! Now I know who to call when we need to chase flavoured cats
  2. @dejhost You can find the value of the @extended here, but you might post your script so people can assist you more
  3. @Shark007 Glad I could help
  4. @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
  5. @Nine Nice idea, but what do you think about this one? Here @mikell, *smooch smooch smooch*
  6. I knew I should have bring a dog here
  7. @Nine Use + instead of * in the capturing group, otherwise the function returns even the last blank line
  8. @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
  9. Did you find anything useful in it? Maybe this couls help?
  10. Hi @dogisay, and to the AutoIt forum. Could you please post a runnable script, so we can try to assist you?
  11. @Earthshine Nice profile picture
  12. @jaja714 I've never used OracleDB, so I can't say what is wrong there but, have you checked this?
  13. @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
  14. @jaja714 Just look for them
  15. @jaja714 Just an overview of what you can do with ADO and AutoIt
  16. @CraZyNes You should post the script
  17. @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
  18. @cag8f ConsoleWrite("Two Digits Year: " & _TwoDigitsYear() & @CRLF) Func _TwoDigitsYear() Return StringRight(@YEAR, 2) EndFunc
  19. @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
  20. @USSSR You could try to obtain the handle of the control, and then use _GUICtrlListView_* functions to see if you can retrieve what you are looking for; else, try UIASpy and use UIAutomation
  21. Which it has already been suggested, but seems that the OP is a "post and quit" fan.
  22. @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
  23. @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?
  24. Hi @rotac, and to the AutoIt forum! Could you please post the entire script?
×
×
  • Create New...