czardas Posted June 6, 2018 Posted June 6, 2018 (edited) 14 hours ago, BrewManNH said: But it's necessary for clarity, such as the reference to declaring a Global Static variable being meaningless. I said it was an exception in the next sentence. However one thing I said was incorrect: I'm about to change that. Edited June 7, 2018 by czardas operator64 ArrayWorkshop
pixelsearch Posted June 7, 2018 Author Posted June 7, 2018 On lundi 4 juin 2018 at 3:44 PM, Melba23 said: pixelsearch, You can initially declare the array as Global $aHistorique[0][9] - then you will not get the blank line. M23 Hi Melba23 I started to change my few scripts using this relatively new feature you explained me (the [0] row during declaring the Array, to avoid a blank row if the Array is intented to be populated with __ArrayAdd) All when fine except one thing which created an error in the include file ArrayDisplayInternals.au3 , function __ArrayDisplay_Share, line 343, $vTmp = $aArray[$i][$j] . The error can be reproduced like this : #include <Array.au3> Global $aHistorique[0][9] _ArrayDisplay($aHistorique, "Title") ; ok _ArrayDisplay($aHistorique, "Title", "|4") ; error and Console shows : "C:\Program Files\AutoIt3\Include\ArrayDisplayInternals.au3" (343) : ==> Variable subscript badly formatted.: $vTmp = $aArray[$i][$j] $vTmp = $aArray[^ ERROR Displaying the variables with MsgBox placed immediately before line 343 shows this : $i = -1 and $j = 0 This didn't happen when using Global $aHistorique[1][9] because the Array display showed the 1st columns of an empty row. Hoping these informations were useful "I think you are searching a bug where there is no bug..."
pixelsearch Posted June 7, 2018 Author Posted June 7, 2018 In case it may help readers facing the same issue, here is a workaround so the script wont stop if the array is empty : _ArrayDisplay($aHistorique, "Title", ((Ubound($aHistorique) = 0) ? ("") : ("|4"))) "I think you are searching a bug where there is no bug..."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now