-
Posts
520 -
Joined
-
Last visited
-
Days Won
2
Community Answers
-
Luigi's post in Replicate PHP pack('H*' ... in autoit was marked as the answer
@Kyan, try this:
Func _packH($sInput) Local $sReply = "" For $xx = 1 To StringLen($sInput) Step 2 $sReply &= Chr(Dec(StringMid($sInput, $xx, 2))) Next Return $sReply EndFunc ;==>_packH -
Luigi's post in build a array ( unknow lines x know columns ) by itens number was marked as the answer
I made this little change...
Local $iQuant = 5 ; number of apps to show Local $aCell[2] = [0, 4] ; $aCell[0] is unknow number of lines ; $aCell[1] is know number of columns $iRows = Floor(($iQuant - 1) / $aCell[1]) ; How many 4's are there to fit in? ConsoleWrite("[" & $iRows & ", " & $aCell[1] & "]" & @CRLF) I do not need itereate all elements, I need know how many lines is necessary to show "n" elments in an array with determinate number of columns...
Your code show this in one line, and more easy to understand than mine first code...
Both work fine, your is more easy.
Thank you again.
Br, Detefon
-
Luigi's post in OLE/COM Object -> WMI was marked as the answer
See _WinAPI_ReadDirectoryChanges.
Maybe that is the way.
Br, Detefon.
-
Luigi's post in DriveGetDrive() and _ArrayDelete() was marked as the answer
Use _ArrayDel() on-the-fly or iterate a loop and delete an item of the same array... Not good for me.
I always use @error immediately after the function. I never let anything between function and @error.
Nowadays, I avoid using nested conditionals (before I used a lot).
Those are my practices.
Maybe this?
#include <Array.au3> Local $var = getUsbDrives() _ArrayDisplay($var) Func getUsbDrives() Local $aDel[1] Local $aDrives = DriveGetDrive("all") If @error Then MsgBox(4096, "DriveGetDrive", "It appears an error occurred.") Else For $ii = 1 To $aDrives[0] Switch DriveGetType($aDrives[$ii]) Case "Fixed", "Removable" If Not ($aDrives[$ii] == @HomeDrive) Then _ArrayAdd($aDel, $ii) EndSwitch Next For $ii = 1 To UBound($aDel, 1) - 1 _ArrayDelete($aDrives, $aDel[$ii]) Next EndIf If UBound($aDel, 1) Then _ArrayDelete($aDrives, 0) Return $aDrives EndFunc ;==>getUsbDrives -
Luigi's post in Script won't run from .exe but fine from .a3x was marked as the answer
Recompile again...
Sometimes I need recompile many times.
Or try compile with your AV disabled.
BR, Detefon