Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/28/2022 in all areas

  1. Here one way : Local $hWnd = WinGetHandleEX("You apps here", "Search|Open|Reset") ConsoleWrite($hWnd & @CRLF) Func WinGetHandleEX($sTitle, $sText) Local $aList = StringSplit($sText, "|") Local $aWin = WinList($sTitle) For $i = 1 To $aWin[0][0] $sGetText = WinGetText($aWin[$i][1]) For $j = 1 to $aList[0] If Not StringInStr($sGetText, $aList[$j]) Then ContinueLoop 2 Next Return $aWin[$i][1] Next EndFunc
    2 points
  2. Musashi

    PRINT CURRENT DAY - (Moved)

    Runs fine for me with AutoIt 3.3.14.0 #include <Date.au3> $sCurrentDate = _NowCalcDate() ; current date in format YYYY/MM/DD $aYMD = StringSplit($sCurrentDate, "/", 2) $iWeekday = _DateToDayOfWeek($aYMD[0], $aYMD[1], $aYMD[2]) $sLongDayName = _DateDayOfWeek ( $iWeekday, $DMW_LOCALE_LONGNAME) MsgBox ( 4096 , "" , "DAY IS : " & $sCurrentDate & " " & $sLongDayName)
    1 point
  3. gorillamath, You do not have to declare a length in all cases - but there are 2 types of data collection variables in AutoIt - arrays and maps - which both use very similar notation. It is the manner in which the variable is declared which determines its type: Local $aVar[3] ; An Array Local $vVar[3] = [1, 2, 3] ; An Array ) Local $vVar[] = [1, 2, 3] ; An Array ) These 3 declarations are functionally identical Local $vVar = [1, 2, 3] ; An Array ) Local $mVar[] ; A Map So as you can see, there is no need to declare the size of an array if you declare the content at the same time. Declaring neither size nor content creates a map. Does that help? M23
    1 point
  4. czardas

    check array empty

    No it does not work well. To test the first element, you could use: If $aArray[0] == "" Then MsgBox(0, "Contents", "nothing") To test if the array actually contains elements, you should use: If UBound($aArray) = 0 Then MsgBox(0, "Contents", "zero elements") These examples will only work with 1D arrays.
    1 point
  5. Holy cow, Figured it out. Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.Load("C:\File.xml") ;Xpath Exists--$N > 0 $N=$oXML.SelectNodes("//Parent/Child").length ;Xpath does not Exist--$N =0 $N=$oXML.SelectNodes("//Parent/yyChildxx").length I just realized that I needed to add ".length" $N is never an array. Thanks again----
    0 points
×
×
  • Create New...