Azothoras Posted April 21, 2009 Posted April 21, 2009 (edited) Firstly I've declared the array globaly... (I've also tried not declaring it etc) $arr = _IETableWriteToArray($tablesss) ; Read the table to the array (yes $tablesss is declared earlier $loc = _ArraySearch($arr, "Översikter", 0, Ubound($arr), 0, 1); This actually finds this in the array (but only when it actually exists If NOT @Error Then ; Check if the above succeded _ArrayDisplay($arr) ; This displays that the array contains 4 rows of text (0, 1, 2, 3) ;~ $resstring = $arr[1] ; This crashes the entire script and I have no idea why because of the above... msgbox(0, "", _ArrayToString($arr, @tab, 0, 3)) ; Displays NOTHING :'( ;~ MsgBox(0, "", @error) ; Error is 0 msgbox(0, "", _ArrayPop($arr) & @crlf & _ArrayPop($arr) & @crlf & _ArrayPop($arr) & @crlf & _ArrayPop($arr)); Should display atleast something but no... Nothing here either ;~ MsgBox(0, "", @error) ; Error is 0 Please help what am I doing wrong?! Edited April 21, 2009 by Azothoras
P0ZiTR0N Posted April 21, 2009 Posted April 21, 2009 (edited) can you add more lines of code? p.s. display of array to new pop-up window - _ArrayDisplay($arr,"window") Edited April 21, 2009 by P0ZiTR0N
Moderators Melba23 Posted April 21, 2009 Moderators Posted April 21, 2009 Azothoras,If I set $arr manually to a 4 line text array everything works for me:#include <Array.au3> ;$arr = _IETableWriteToArray($tablesss); Read the table to the array (yes $tablesss is declared earlier Global $arr[4] = ["Zero", "Översikter", "Two", "Three"] $loc = _ArraySearch($arr, "Översikter", 0, UBound($arr), 0, 1); This actually finds this in the array (but only when it actually exists ConsoleWrite($loc & @CRLF) If Not @error Then; Check if the above succeded _ArrayDisplay($arr); This displays that the array contains 4 rows of text (0, 1, 2, 3) ;~ $resstring = $arr[1] ; This crashes the entire script and I have no idea why because of the above... MsgBox(0, "", _ArrayToString($arr, @TAB, 0, 3)); Displays NOTHING :'( ;~ MsgBox(0, "", @error) ; Error is 0 MsgBox(0, "", _ArrayPop($arr) & @CRLF & _ArrayPop($arr) & @CRLF & _ArrayPop($arr) & @CRLF & _ArrayPop($arr)); Should display atleast something but no... Nothing here either ;~ MsgBox(0, "", @error) ; Error is 0 EndIfWhat error message does SciTE give you when you try to use _ArrayDisplay and the script crashes? What return value do you get if you use _IsArray($arr)?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Azothoras Posted April 21, 2009 Author Posted April 21, 2009 (edited) Ty for replies... I am such a noob Did a test to see if the array had more than one dimension (Didn't show in _ArrayDisplay but I tested anyway) and as it turned out it had two dimension... lol 1 was hidden... wtf? Got a new problem now though... D:\Program\AutoIt3\Include\IE.au3 (2157) : ==> The requested action with this object has failed.: $i_col = $i_col + $td.colSpan $i_col = $i_col + $td.colSpan^ ERROR Seems like the IE.au3 causes the error... (I get this error randomly not all the time) Sometimes within 2 seconds of the script and sometimes it can run for 30 minutes... Edited April 21, 2009 by Azothoras
PsaltyDS Posted April 21, 2009 Posted April 21, 2009 Ty for replies... I am such a noob Did a test to see if the array had more than one dimension (Didn't show in _ArrayDisplay but I tested anyway) and as it turned out it had two dimension... lol 1 was hidden... wtf? Got a new problem now though... D:\Program\AutoIt3\Include\IE.au3 (2157) : ==> The requested action with this object has failed.: $i_col = $i_col + $td.colSpan $i_col = $i_col + $td.colSpan^ ERROR Seems like the IE.au3 causes the error... (I get this error randomly not all the time) Sometimes within 2 seconds of the script and sometimes it can run for 30 minutes... _IETableWriteToArray() always returns a 2D array unless it fails (returns 0). If there is only one column it may look like a 1D array in _ArrayDisplay(), but every reference would have to have [n][0] vice just [n]. When you already know there will only be one column (or you are only interested in the first column regardless) you can hard code for [n][0] in your references. Add _IEErrorHandlerRegister() near the top of your script and run it from SciTE to get fuller debug information. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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