Jump to content

Quirinus

Members
  • Posts

    6
  • Joined

  • Last visited

Quirinus's Achievements

  1. Nice, I'll check it out tomorrow and let you know!
  2. No problem, take it slow, I'm just glad to be of help, and that I've solved the problem (at least from what I can see). Cheers!
  3. 1. The $bRow default value in the 3.3.13.15 documentation is listed as True. In 3.3.12.0 it was listed as False. In both cases it's False in the Array.au3. So, for the new version, it should be changed to $bRow = True in the Array.au3. 2. _ArraySwap isn't listed in the internal Array.au3 function list. 3. There's no check for $iIndex_2 bounds. Just double these two lines: If $iIndex_1 < 0 Or $iIndex_1 > $iDim_2 Then Return SetError(4, 0, -1) If $iIndex_1 < 0 Or $iIndex_1 > $iDim_1 Then Return SetError(4, 0, -1) and change $iIndex_1 to $iIndex_2 in the two new lines. 4. I think there's something wrong with $iStart and $iEnd bounds checking. I think this fixes it... switch these two lines: If $iStart > $iDim_2 Or $iEnd > $iDim_2 Then Return SetError(4, 0, -1) If $iStart > $iDim_1 Or $iEnd > $iDim_1 Then Return SetError(4, 0, -1) 5. Is it just me, or are the definitions of columns and rows swapped in this function? I might be imagining things because it's late... if it's true, then you might consider renaming $bRow to $bColumn or switching the if-else parts of the code (there's 2 of them). 6. I suggest using -1 as default $iStart and $iEnd value instead of 0, because someone might want to swap just the first (0-th) elements, and this doesn't let him do it (if swaps the whole row/column in that case). Obviously then the bounds checking would have to be written a bit differently to acknowledge this special case. I think it should be done, because the function as is now does not do what is advertised in the documentation. Here's some code that reproduces some of the problems: #include <Array.au3> $string = "Id|hcIdx|BaseId|NextInClass|TransLvl|NameStr|MonStatsEx|MonProp" & @CRLF & "skeleton1|0|skeleton1|skeleton2|3|RathmaPriest|zakarumcleric2|other" & @CRLF & "skeleton2|1|skeleton1|skeleton3|1|QuotedForTruth|skeleton2|" & @CRLF & "skeleton3|2|skeleton1|skeleton4|2|BoneWarrior|skeleton3|" local $array[1][8] _ArrayAdd($array, $string) _ArrayDelete($array, 0) _ArrayDisplay($array) _ArraySwap($array, 0, 2,True,0,1) _ArrayDisplay($array) I haven't checked if any other function has similar problems... I might be wrong in some of these points, so please do point out if I've made a mistake, since it's quite late and I'm tired and sleepy. I'm checking here before I submit a ticket, if it's needed. Thanks!
  4. My post was before that beta build was out and the assumption in the post was correct, as well. Thanks for developing this awesome program and providing assistance, both are greatly appreciated!
  5. Thanks, Melba23! Would be cool if you posted the fix too next time, but no problem, it's not a hard one to find, and I guess the next release isn't far off. I took a look at Array.au3 and found the issue, if anyone needs a quick fix before the beta is out. It works if I remove the line: If $iEnd_Row = 0 Then $iEnd_Row = $iDim_1 from the start of _ArrayToString function, and this line: If $iEnd_Col = 0 Then $iEnd_Col = $iDim_2 under the Case 2. I'm not sure if it messes up something else, but it works to my satisfaction. I noticed the same problem with _ArrayExtract, so I submitted a ticket here: http://www.autoitscript.com/trac/autoit/ticket/2824#ticket Also, the documentation for _ArrayExtract is wrong, as indicated in the ticket.
  6. It's bugged or I'm doing it wrong. Consider this example: #include <Array.au3> #include <MsgBoxConstants.au3> Local $aArray[10][10] For $i = 0 To 9 For $j = 0 To 9 $aArray[$i][$j] = $i & "-" & $j Next Next _ArrayDisplay($aArray, "2D Array") $start_col = 0 MsgBox($MB_SYSTEMMODAL, "Rows 4-7, cols 2-5", _ArrayToString($aArray, " :: ", 0, 9, @CRLF, $start_col, $start_col)) It produces the whole array, all cells joined by " :: " and all rows joined by @CRLF. It should produce just the 0-th row. If you change $start_col to 1 or any other number, it works correctly. Does anyone have any idea what is wrong in my code or the _ArrayToString code in Array.au3? I would try to figure out what's the problem in the Array.au3, but I don't have time to do it now. If no one figures it out I might give it a try later on.
×
×
  • Create New...