Recently Browsing 0 members
No registered users viewing this page.
I have a string containing the full path of an executable and an array of executables without their paths. I am trying to compare the string to the list in the array and if a match is found, remove it from the array. The entry get removed from the array successfully, and after checking its return result, uses it to update the ubound if it succeeded, but it doesn't want to update to the new value. Any ideas what I am doing wrong? It acts like it is read-only.
#include <Array.au3> #include <File.au3> Local $sApp_Exe = "F:\App\Nextcloud\nextcloud.exe" Local $aWaitForEXEX = [3, "Nextcloud.exe", "nextcloudcmd.exe", "QtWebEngineProcess.exe"] For $h = 1 To $aWaitForEXEX If StringInStr($sApp_Exe, $aWaitForEXEX[$h]) <> 0 Then $iRet = _ArrayDelete($aWaitForEXEX, $h) If $iRet <> -1 Then $aWaitForEXEX = $iRet ;this line doesn't work. $aWaitForEXEX doesn't update and shortly gives Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.: _ArrayDisplay($aWaitForEXEX) EndIf Next
#Include <Array.au3> #include <Constants.au3> $s = FileRead("2.txt") Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 StringRegExpReplace($s, '(?i)\b' & $w[$i] & '\b', $w[$i]) $w[$i] = @extended Next _ArraySort($w, 1, 0, 0, 1) _ArrayDisplay($w) i have this script that returns 3 columns
i need to copy the Col 0 and Col 1 as text to paste on notepad or excel
you will have to create a "copy" button if possible
I have a dataset like this, (a strubg)
Username: User1 Type: Admin RegDate: 1999 Username: User2 Type: User RegDate: 2000 How to make a 2 dimensional array that I can display with _ArrayDisplay?
This would be a perfect 2D array to represent my data:
Username Tpye RegDate User1 Admin 1999 User2 User 2000 If you run this Powershell this powershell command, you can get this dataset that I am talking about:
Get-LocalUser | Select * With this code you can try it to read into a string:
#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" #include <Array.au3> ; Just for display in example #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion $sCommand = "powershell.exe Get-LocalUser | Select *" Local $iPid = Run($sCommand, @WorkingDir , @SW_SHOW , $STDOUT_CHILD) ProcessWaitClose($iPid) Local $sOutput = StdoutRead($iPID) ConsoleWrite($sOutput) How can I correctly split $sOutput into a 2D array (with the above mentioned layout) that I can display and I work with?
$sCommands1 = 'powershell.exe Get-ChildItem' $iPid = run($sCommands1 , @WorkingDir , @SW_SHOW , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd ;~ msgbox(0, '' , $sOutput) ConsoleWrite("$sOutput") ConsoleWrite($sOutput) ConsoleWrite(@CRLF) $aOutput = stringsplit($sOutput ,@LF , 2) For $i=0 To UBound($aOutput) - 1 Step 1 ConsoleWrite($aOutput[$i]) Next The script above reads the whole directory into a one dimensional array, but I need to work with the array, so I need to split the array into multiple dimensions.
I have already read some forum answers here, and I have already tried these commands:
Are there any way to use the $aOutput variable like in PowerShell:
$a = Get-ChildItem $a.Mode I imagine this in AutoIt $aOutput
ConsoleWrite($aOutput[i].Mode) Or if I split this command into 2 dimension like:
For $i To UBound($aOutput)-1 Step 1 ConsoleWrite($aOutput[$i]) ConsoleWrite($aOutput[$i]) Next
Please help with this 3D Array the first example works the secound doesn't.
Need help to understand how Arrays work.
Many thanks in advance
;First Example Dim $aArray $aArray = 1 $aArray = 2 $aArray = 3 $aArray = 4 $aArray = 5 $aArray = 6 $aArray = 7 $aArray = 8 For $a = 0 to 1 for $b = 0 to 1 for $c = 0 to 1 ConsoleWrite($aArray[$a][$b][$c] & @CRLF) Next Next Next ;Secound Example Local $aArraym =[[[1,2,],[3,4],[5,6],[7,8]]] For $a = 0 to 1 for $b = 0 to 1 for $c = 0 to 1 ConsoleWrite($aArraym[$a][$b][$c] & @CRLF) Next Next Next