Search the Community
Showing results for tags 'length'.
-
Code is simple/selfexplanatory ... #include "Array.au3" $a = StringSplit('aaa,b,cc', ',', 2) ; no_count _ArraySortLen($a) _ArrayDisplay($a, '$a - without count') $b = StringSplit('aaa,b,cc', ',') _ArraySortLen1($b) _ArrayDisplay($b, '$b - with count') ; zero based array (without count at [0]) Func _ArraySortLen(ByRef $aArr, $iDescending = 0) Local $j = UBound($aArr)-1 Local $aTemp[$j+1][2] For $i = 0 To $j $aTemp[$i][0] = StringLen($aArr[$i]) $aTemp[$i][1] = $aArr[$i] Next _ArraySort($aTemp,$iDescending) For $i = 0 To $j $aArr[$i] = $aTemp[$i][1] Next EndFunc ; one based array (with count at [0]) Func _ArraySortLen1(ByRef $aArr, $iDescending = 0) Local $j = $aArr[0] Local $aTemp[$j+1][2] For $i = 1 To $j $aTemp[$i][0] = StringLen($aArr[$i]) $aTemp[$i][1] = $aArr[$i] Next _ArraySort($aTemp,$iDescending,1) For $i = 1 To $j $aArr[$i] = $aTemp[$i][1] Next EndFunc
-
I'm trying to get the length of the WMI object I have created. I've tried using .count() and .length() to no avail. Can anyone shed some light on maybe something I'm missing? Local $oWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") If @error Then Return SetError(@error, 0, "") Local $oItems = $oWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name LIKE '%(COM%)'", "WQL", 48) MsgBox(0, "", "Number of Ports: " & $oItems)
-
Hi, i wanted to make inputbox password, need to get it's chars length in it, because the "password char" is too secure and i need the user to know if he is writing or not!! here's my effort Global $length, $Pw $Pw = InputBox("Security", "Type password to Encrypt/Decrypt file." & @CRLF & "Notice: password case sensitive" & @CRLF & "Pw length: " & $length, "", "ٌ", 220, 150) $length = StringLen($Pw) MsgBox(0, "", $length) i tried to put $length above $Pw but didn't work too. thanks