Jump to content

[Solved] URGENT: Array size error!?


Xibalba
 Share

Recommended Posts

Hello,

I have an array declared as followed:

Global Const $myArray[73][3] = _
  [ _
   ["0", "4", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
   ["1", "3", "0011000000000011000000000011111111110001111111111000"], _
   ["2", "2", "0000000011111111110001111111111000"], _
   (~60 more rows)
  ]

This has worked fine until my last inserted element. Script doesn't start, saying:

"Error: String missing closing quote."

And points at the array declaration.

First I thought it was some random syntax error on my part, but then I tested the following:

By removing ANY 5 lines (rows) ANYWHERE in the array, and the script runs just fine.

And so it must be some other error, most likely some sort of range- or capacity-limit reached.

What is wrong? What limits can possible have been reached? How can I continue debugging?

  • The [73] position declaration is just temporary and cannot have anything to do with it since it's NOT reached (tested increasing).
  • The array is properly closed with "_" instead of ", _" after the last bracket.
  • As I said, removing any 5 lines works
  • The 3 positions all contain strings. The longest string is of length 143.

Thanks in advance, really need to sort this out asap! :\

Edited by Xibalba
Link to comment
Share on other sites

  • Moderators

Xibalba,

You have hit the 4095 character line limit. :)

You will need to split your declaration into smaller chunks, which with a 2D array is not that simple. Have you thought of storing the elements in a file and then reading them in from there into the array? You would need a bit more coding, but nothing more complicated than a couple of nested loops. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

You have hit the 4095 character line limit. :)

That limit was removed a few versions ago (3.3.3.2 Beta).

The syntax checker simply doesn't like the funky syntax you are using. Stop using it. This will work every time, regardless of size:

Global Const $myArray[73][3] = [["0", "4", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
        ["1", "3", "0011000000000011000000000011111111110001111111111000"], _
        ["2", "2", "0000000011111111110001111111111000"], _
        ["71", "1", "0011000000000011000000000011111111110001111111111000"], _
        ["72", "0", "0000000011111111110001111111111000"]]

;)

Edited by PsaltyDS
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
Link to comment
Share on other sites

That limit was removed a few versions ago (3.3.3.2 Beta).

The syntax checker simply doesn't like the funky syntax you are using. Stop using it. This will work every time, regardless of size:

Global Const $myArray[73][3] = [["0", "4", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
        ["1", "3", "0011000000000011000000000011111111110001111111111000"], _
        ["2", "2", "0000000011111111110001111111111000"], _
        ["71", "1", "0011000000000011000000000011111111110001111111111000"], _
        ["72", "0", "0000000011111111110001111111111000"]]

;)

Same error.
Link to comment
Share on other sites

Post the exact, full demo (in code tags, of course) with no pseudo code or "(~60 more rows)" in it.

And what version are you running?

I tried mine with 300 appended lines of over 200 characters each:

#include <Array.au3>

Global Const $myArray[1000][3] = [["011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
        ["011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
        ["011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _

; ... copy above line over 300 times

        ["011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000"], _
        ["011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000", "011111111000011111111110001000000001000100000000100011111111110000111111110000"]]

_ArrayDisplay($myArray, "$myArray")

;)

Edit: Oops, posting the large demo triggered code protection on the board.

Edited by PsaltyDS
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
Link to comment
Share on other sites

v. 3

Or how do I find out exact version? (3.x.x?)

EDIT: From the helpfile I'm using (AutoIt3.chm): v3.3.2.0

Uh huh... ;)

Note the version I said fixed this above (3.3.3.2 Beta), and the fact that the current version is 3.3.6.1 Production.

:)

P.S. You can get the exact version in your scripts with the @AutoItVersion macro.

Edited by PsaltyDS
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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...