Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/09/2020 in all areas

  1. Example() Func Example() ; Create a constant variable in Local scope of the filepath that will be read/written to. Local Const $sFilePath = "Test.ini" ; Create an INI section structure as an array. The zeroth element is how many items are in the array, in this case 3. Local $aSection[4][2] = [[3, ""], ["Test", "AutoIt"], ["Test", @AutoItVersion], ["Test", @OSVersion]] ; Write the array to the section labelled 'General'. IniWriteSection($sFilePath, "General", $aSection) EndFunc ;==>Example
    2 points
  2. Your starting and ending indexes, on the second array search need to be reversed. It should be: $jIndex = _ArraySearch($avArray, $bSearch, 0, $iIndex, 0, 1, 0) If you look at the _ArraySearch function's logic, in the array.au3 UDF, you'll see that if $iForward is true false, it will reverse the indexes. Therefore, you should set the starting and ending index parameters as you normally would, from top to bottom. By setting the $iForward flag to true false, it will correctly search the defined range in reverse order. Edit: I didn't see that @Musashi had already replied. 😃
    2 points
  3. Use : Local $jIndex = _ArraySearch($avArray, $bSearch, 0, $iIndex, 0, 0, 0) instead of : Local $jIndex = _ArraySearch($avArray, $bSearch, $iIndex, 0, 0, 0, 0)
    2 points
  4. roeselpi, Delighted I could help. But I would echo the comments above - if you could explain just what it is you are trying to do in the "real world" rather than just posting a programming conundrum, we might be able to offer even more elegant solutions. A good example is a thread from some time ago where in this post the OP explained exactly what he was trying to do: In this case once we understood the exact requirement we were able to come up with some really good solutions far removed from the original code framework. M23
    2 points
  5. Here's an example that processes the XML file using the XML UDF. This is not meant to be complete a solution. It is merely an example framework that you can learn from and build upon. I tried to document it well enough for you to get a general idea of what each block of code is doing. I also tried to give you an example of how you can process the different types of value structures that are in your XML file (single value, static number of sub values, dynamic number of sub values). As you said is preferable, the logic handles a variable number of CD entries from 0 to how ever many there are. It does so by creating an array of CD entries and placing that array as one of the array columns in the MainEvents array row. #include <Constants.au3> #include <Array.au3> #include <xml.au3> example() Func example() Const $XML_FILE = "lm06.xml" ;<-- Point to your xml file Local $oXmlDoc, $oNodes, $oNode Local $iCDCount Enum $MAIN_EVENTID, $MAIN_INFOZ, $MAIN_TITLE, $MAIN_AS1, $MAIN_AS2, $MAIN_AS3, $MAIN_CDARRAY, $MAIN_FLD_COUNT Local $aMainEvents[0][$MAIN_FLD_COUNT] Enum $CD_ID, $CD_CDN1, $CD_CDN2, $CD_CDN3, $CD_CDN4, $CD_FLD_COUNT Local $aCDs[0][$CD_FLD_COUNT] ;Create XML document object & load xml file $oXmlDoc = _XML_CreateDOMDocument() _XML_Load($oXmlDoc, $XML_FILE) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "_XML_Load failed - @error = " & @error) ;Select //Main/Event nodes $oNodes = _XML_SelectNodes($oXmlDoc, '//Main/Event') If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error selecting //Main/Event nodes - @error = " & @error) ;Process //Main/Event nodes For $i = 0 To $oNodes.Length - 1 ;Add and populate an array row _ArrayAdd($aMainEvents, "") $oNode = $oNodes.Item($i) $aMainEvents[$i][$MAIN_EVENTID] = _XML_GetValue($oNode, '@id')[1] $aMainEvents[$i][$MAIN_INFOZ] = _XML_GetValue($oNode, 'InfoZ')[1] $aMainEvents[$i][$MAIN_TITLE] = _XML_GetValue($oNode, 'TITLE')[1] $aMainEvents[$i][$MAIN_AS1] = _XML_GetValue($oNode, 'AddInfo/AS1')[1] $aMainEvents[$i][$MAIN_AS2] = _XML_GetValue($oNode, 'AddInfo/AS2')[1] $aMainEvents[$i][$MAIN_AS3] = _XML_GetValue($oNode, 'AddInfo/AS3')[1] ;Create a dynamic array of CD entries and add the array to the main array row $iCDCount = _XML_GetValue($oNode, 'NumberOfCD')[1] ReDim $aCDs[0][$CD_FLD_COUNT] For $j = 0 To $iCDCount - 1 ;Add and populate a CD array row _ArrayAdd($aCDs, "") $aCDs[$j][$CD_ID] = _XML_GetValue($oNode, 'CD[' & $j + 1 & ']/@ID')[1] $aCDs[$j][$CD_CDN1] = _XML_GetValue($oNode, 'CD[' & $j + 1 & ']/CDN1')[1] $aCDs[$j][$CD_CDN2] = _XML_GetValue($oNode, 'CD[' & $j + 1 & ']/CDN2')[1] $aCDs[$j][$CD_CDN3] = _XML_GetValue($oNode, 'CD[' & $j + 1 & ']/CDN3')[1] $aCDs[$j][$CD_CDN4] = _XML_GetValue($oNode, 'CD[' & $j + 1 & ']/CDN4')[1] Next $aMainEvents[$i][$MAIN_CDARRAY] = $aCDs Next ;Display Main Events array _ArrayDisplay($aMainEvents, "Main Events", "", 0, Default, _ "ID|InfoZ|Title|AS1|AS2|AS3|CDARRAY") ;Display CD array of first Main Event row (as an example) _ArrayDisplay($aMainEvents[0][$MAIN_CDARRAY], "Main Events[0] CD Array", "", 0, Default, _ "ID|CDN1|CDN2|CDN3|CDN4") ;Display CD array of last Main Event row (there are none - empty array) _ArrayDisplay($aMainEvents[3][$MAIN_CDARRAY], "Main Events[3] CD Array", "", 0, Default, _ "ID|CDN1|CDN2|CDN3|CDN4") EndFunc Array Displays Using Your XML File:
    2 points
  6. water

    recursivity - (Moved)

    What do you mean by "recursivity behavior"? How did you notice that it is different between W7 and W1ß?
    1 point
  7. You're welcome. If you look at the code in the json.au3 file, you will see that it stores json objects as dictionaries. There are helper functions (JsonObj*) already in the json.au3 file that will let you access and manipulate those objects. I just used the methods directly, instead of the helper functions, because I wanted to save a few keystrokes.
    1 point
  8. roeselpi, As the substitution algorithm for the value to insert into $workarray03 based on the values in $workarray01/02 is extremely simple you can shorten the code quite a lot - just look for my comments in the <<<<<<<<<<< lines: #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> #include <String.au3> Global $maxsize = 8 ; Declare this here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; ---------------------------------------------------------------- ; PART A: GUI ; ---------------------------------------------------------------- ; not needed here for demonstration (is not built yet anyway) ; ---------------------------------------------------------------- ; PART B: declare all variables that are for the basic functioning ; ---------------------------------------------------------------- ; Covert these individual values to arrays <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; ---------- for testing: $a will be alphabetical chars Global $arrayletter[$maxsize] = ["A", "B", "C", "D", "E", "F", "G", "H"] ; ---------- for testing: $n will be numerical chars Global $arraynumber[$maxsize] = [11, 12, 13, 14, 21, 22, 23, 24] ; ------------------------------------------------------------------ ; Forum-Information: ; For Simplification: A=11, B=12, C=13, D=14, E=21, F=22, G=23, H=24 ; ------------------------------------------------------------------ ; ---------------------------------------------------------------- ; PART C: create work-arrays and fill with replacable data ; ---------------------------------------------------------------- #cs ; The following would be defined as a Function ... so: begin function here Global $workarray01[4] = ["#", "#", "#", "#"] Global $workarray02[4] = ["#", "#", "#", "#"] Global $workarray03[4] = ["#", "#", "#", "#"] Global $workarray04[4] = ["#", "#", "#", "#"] For $i = 0 To 4 _ArrayConcatenate ($workarray01, $workarray01) Next For $i = 0 To 4 _ArrayConcatenate ($workarray02, $workarray02) Next For $i = 0 To 4 _ArrayConcatenate ($workarray03, $workarray03) Next For $i = 0 To 4 _ArrayConcatenate ($workarray04, $workarray04) Next ReDim $workarray01[$maxsize] ReDim $workarray02[$maxsize] ReDim $workarray03[$maxsize] ReDim $workarray04[$maxsize] #ce ; Just declare these arrays at full size, no need to fill them <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Global $workarray01[$maxsize] Global $workarray02[$maxsize] Global $workarray03[$maxsize] Global $workarray04[$maxsize] ; ............................................end function here ; ---------------------------------------------------------------- ; PART D: here comes the userdata ... the data the user has typed ; ---------------------------------------------------------------- Local $userdatastring01 = "abefh" $userdataupcasestring01 = StringUpper($userdatastring01) $userdataarray01 = StringSplit($userdataupcasestring01, "", $STR_NOCOUNT) ; Only concatenate enough times to get just a little over $maxsize... <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 1 To Ceiling($maxsize / StringLen($userdatastring01)) _ArrayConcatenate ($userdataarray01, $userdataarray01) Next ; ...and then trim as required ReDim $userdataarray01[$maxsize] _ArrayDisplay($userdataarray01, "userdata 1") Local $userdatastring02 = "cdg" $userdataupcasestring02 = StringUpper($userdatastring02) $userdataarray02 = StringSplit($userdataupcasestring02, "", $STR_NOCOUNT) ; Same here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 1 To Ceiling($maxsize / StringLen($userdatastring02)) _ArrayConcatenate ($userdataarray02, $userdataarray02) Next ReDim $userdataarray02[$maxsize] _ArrayDisplay($userdataarray02, "userdata 2") ; --------- ALL Arrays are now exactly the same size. each 8 digits long ; ---------------------------------------------------------------- ; PART E: filling the workarrays with the correct numeric values ; ---------------------------------------------------------------- #cs ; The following would be defined as a Function ... so: begin function here For $i = 0 To UBound($userdataarray01) - 1 If $userdataarray01[$i] = $a11 Then $workarray01[$i] = $n11 If $userdataarray01[$i] = $a12 Then $workarray01[$i] = $n12 If $userdataarray01[$i] = $a13 Then $workarray01[$i] = $n13 If $userdataarray01[$i] = $a14 Then $workarray01[$i] = $n14 If $userdataarray01[$i] = $a21 Then $workarray01[$i] = $n21 If $userdataarray01[$i] = $a22 Then $workarray01[$i] = $n22 If $userdataarray01[$i] = $a23 Then $workarray01[$i] = $n23 If $userdataarray01[$i] = $a24 Then $workarray01[$i] = $n24 Next ; .......................................................end function here #ce ; As you have the values in arrays, you can easily loop through them <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To $maxsize - 1 For $j = 0 To $maxsize - 1 If $userdataarray01[$i] = $arrayletter[$j] Then $workarray01[$i] = $arraynumber[$j] ExitLoop EndIf Next Next ; .......................................................end function here _ArrayDisplay($workarray01, "Transform 1") ; And again here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To $maxsize - 1 For $j = 0 To $maxsize - 1 If $userdataarray02[$i] = $arrayletter[$j] Then $workarray02[$i] = $arraynumber[$j] ExitLoop EndIf Next Next ; ......................................................end function here _ArrayDisplay($workarray02, "Transform 2") ; ---------------------------------------------------------------- ; Forum Information: This is the Part Where I am stuck at the moment: ; ; PART F: combining and resetting the values ; ; ---------------------------------------------------------------- ; And here is the sexy bit!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Work through $workarray01 For $i = 0 To UBound($workarray01) - 1 ; And then look at the possible $workarray01 values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $j = 0 To $maxsize - 1 ; Until we find the correct one <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If $workarray01[$i] = $arraynumber[$j] Then ; Now we look for the corresponding $workarray02 value <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $k = 0 To $maxsize ; And when we find it... If $workarray02[$i] = $arraynumber[$k] Then ; ...we calculate the correct value to insert into $workarray03 $workarray03[$i] = $arraynumber[Mod($k + $j + 1, $maxsize)] ; And as we have finished with this element of $workarray01 we can move onto the next <<<<<<<<<< ExitLoop 2 EndIf Next EndIf Next Next #cs If $workarray01[$i] = $n11 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n11 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n11 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n11 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n11 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n11 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n11 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n11 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n12 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n12 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n12 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n12 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n12 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n12 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n12 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n12 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n13 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n13 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n13 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n13 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n13 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n13 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n13 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n13 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n14 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n14 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n14 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n14 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n14 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n14 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n14 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n14 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n21 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n21 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n21 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n21 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n21 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n21 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n21 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n21 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n22 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n22 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n22 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n22 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n22 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n22 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n22 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n22 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n23 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n24 If $workarray01[$i] = $n23 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n23 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n23 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n23 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n23 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n23 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n23 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n24 And $workarray02[$i] = $n11 Then $workarray03[$i] = $n11 If $workarray01[$i] = $n24 And $workarray02[$i] = $n12 Then $workarray03[$i] = $n12 If $workarray01[$i] = $n24 And $workarray02[$i] = $n13 Then $workarray03[$i] = $n13 If $workarray01[$i] = $n24 And $workarray02[$i] = $n14 Then $workarray03[$i] = $n14 If $workarray01[$i] = $n24 And $workarray02[$i] = $n21 Then $workarray03[$i] = $n21 If $workarray01[$i] = $n24 And $workarray02[$i] = $n22 Then $workarray03[$i] = $n22 If $workarray01[$i] = $n24 And $workarray02[$i] = $n23 Then $workarray03[$i] = $n23 If $workarray01[$i] = $n24 And $workarray02[$i] = $n24 Then $workarray03[$i] = $n24 Next #ce ; ------------------------------------------------------------------ ; Forum-Information: ; Result Should Be ;14=D ;22=F ;14=D ;11=A ;14=D ;24=H ;21=E ;11=A ; ------------------------------------------------------------------ _ArrayDisplay($workarray03, "Combined") ; ---------------------------------------------------------------- ; PART F: convert the numerals back to alphabetical values ; ---------------------------------------------------------------- ; Again work through the elements of $workarray03 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To $maxsize - 1 ; And look at each possibility for its content <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $j = 0 To $maxsize - 1 ; And then change it if necessary <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If $workarray03[$i] = $arraynumber[$j] Then $workarray04[$i] = $arrayletter[$j] ExitLoop EndIf Next Next #cs ; The following would be defined as a Function ... so: begin function here For $i = 0 To UBound($workarray03) - 1 If $workarray03[$i] = $n11 Then $workarray04[$i] = $a11 If $workarray03[$i] = $n12 Then $workarray04[$i] = $a12 If $workarray03[$i] = $n13 Then $workarray04[$i] = $a13 If $workarray03[$i] = $n14 Then $workarray04[$i] = $a14 If $workarray03[$i] = $n21 Then $workarray04[$i] = $a21 If $workarray03[$i] = $n22 Then $workarray04[$i] = $a22 If $workarray03[$i] = $n23 Then $workarray04[$i] = $a23 If $workarray03[$i] = $n24 Then $workarray04[$i] = $a24 Next ; ......................................................end function here ; -------------- now let us look at our reslut (convert array back to string) #ce $result = _ArrayToString($workarray04, "") MsgBox(0, "Result", $result) ; ------------------------------------------------------------------ ; Forum-Information: ; Result Should Be ; ;DFDADHEA ; ; ------------------------------------------------------------------ I have no idea what you are doing with this script, but my version gives you the same result as your rather less elegant code - and in my opinion is scalable to deal with a very much bigger $maxsize value without changing a line. And if $maxsize is very large, you can get rid of $workarray04 and just directly replace the numeric values in $workarray03 with the letters - that would save a fair bit of memory. Please ask if you have any questions. M23
    1 point
  9. Here a simple way to extract some of the tags : #include <Constants.au3> #include <Array.au3> Local Const $TAGS[] = ["<Event id=", "<NumberPR>", "<InfoZ>", "<TITLE>", "<NumberT>", "<AS1>"] Local $sPattern = _ArrayToString($TAGS) Local $aTag1D = StringRegExp(FileRead("Test.xml"), "(" & $sPattern & ")([^<>]*)", 3) Local $aTag2D = _Array_Resize($aTag1D, 2) _ArrayDisplay($aTag2D) Func _Array_Resize(ByRef $aArray1d, $iColumns, $iStart = Default) If IsKeyword($iStart) Then $iStart = 0 Local $iElements = UBound($aArray1d) - $iStart If Mod($iElements, $iColumns) <> 0 Then Return SetError(1, 0, False) Local $aArray2d[$iElements / $iColumns][$iColumns] For $i = 0 To $iElements - 1 $aArray2d[Floor($i / $iColumns)][Mod($i, $iColumns)] = $aArray1d[$i + $iStart] Next Return $aArray2d EndFunc ;==>_Array_Resize Once you got the 2D array, you can reformat at will.
    1 point
  10. mLipok

    _IE Button Click

    Check: You could relate it with id="x1M8_W3-0".
    1 point
×
×
  • Create New...