Sign in to follow this
Followers
0
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By ramin92003
Hi,
How can I get the largest number to be the first number in a calculation? I did the below code but the largest number doesn't store in the $ aExtract variable. I need always a positive number from the calculation (the largest number be the first in the calculation). Can you help me with that? Thank you.
$N1 = 33 $N2 = 45 Local $numberSort [2] = [$N1 , $N2] _ArraySort($numberSort, 1) _ArrayDisplay($numberSort, "Sort Descending", Default, 1) Local $aExtract = _ArrayExtract($numberSort, 0, 0, 0) _ArrayDisplay($aExtract, "Row 1 cols 1") $minus = $N1 - $N2
-
By l3ill
Hi Gents,
Updating one of my older scripts here and cant get around this wall...
I want to extract chunks from an larger array of indefinite size as smaller arrays in a loop and work with them individually and then move on to the the next "extracted array" until the original array is empty.
The amount of elements in each extracted array will usually be different so I am using _ArraySearch to find my start and stop points and storing them as variables, which brings me to my problem.
I want to "remove" (delete) the extracted array from the original array each time using _ArrayDelete but it doesnt seem to want me to use variables.
Here is a reproducer:
#include <Array.au3> Local $aArray[10] For $i = 0 To 9 $aArray[$i] = $i Next _ArrayDisplay($aArray, "Original") $i_Start = 0 $i_End = 5 Local $aExtract = _ArrayExtract($aArray, $i_Start, $i_End) _ArrayDisplay($aExtract, "Extracted Array") Local $vRange = $i_Start - $i_End _ArrayDelete($aArray, $vRange) ;==error 3 - $vRange is not a valid range string If @error Then MsgBox(0, "error =", @error) EndIf _ArrayDisplay($aArray, "After Deletion") Any suggestions would be appreciated :-)
cya,
Bill
edit: the error I am getting is 3 - $vRange is not a valid range string
edit 2: BTW this doesn't work either _ArrayDelete($aArray, $i_Start - $i_End)
-
By Shane0000
I am trying to get column 0 from A 2D array.
In the below example, (adapted from Autoit Example Script for _ArrayExtract)
The first ArrayExtract works as expected and returns only column 1 | Start Column = 1 End column = 1
The Second ArrayExtract returns data from all columns. | Start Column = 0 End column = 0
The Third ArrayExtract works as expected and returns only Row 1 . | Start Row = 1 End Row = 1
The Fourth ArrayExtract returns data from all Rows. | Start Row = 0 End Row = 0
If start = 1 end = 1 returns column 1 And/ row 1 respectively why does start = 0 end = 0 return all rows/columns.
What is the correct variables to use to extract only row 0 OR column 0?
Thank You,
Shane
Edit: Added work around function for anyone who needs it, description near bottom of post.
#include <Array.au3> Local $aArray[4][4] For $i = 0 To 3 For $j = 0 To 3 $aArray[$i][$j] = $i & $j Next Next _ArrayDisplay($aArray, "Original") Local $aExtract = _ArrayExtract($aArray, 0, 3, 1, 1) ; works as expected _ArrayDisplay($aExtract, "Row 0-3 column 1") Local $aExtract = _ArrayExtract($aArray, 0, 3, 0, 0) ; irregular results _ArrayDisplay($aExtract, "Row 0-3 column 0") Local $aExtract = _ArrayExtract($aArray, 1, 1, 1, 3); works as expected _ArrayDisplay($aExtract, "Row 1 column 1 - 3") Local $aExtract = _ArrayExtract($aArray, 0, 0, 1, 3) ; irregular results _ArrayDisplay($aExtract, "Row 0 column 1 - 3")
ArrayExtract.au3
-
By Shane0000
Would one of the devs or the akin look at the post below regarding ArrayExtracts inability to extract row 0 and also column 0.
I am unsure of how where to open a ticket.
If I should do this instead can some one provide a link to the ticket page.
Thank you,
Shane
'?do=embed' frameborder='0' data-embedContent>>
-