Jump to content

How large can you have an array??


dickep
 Share

Recommended Posts

I looked over this forum and found a different number of replies to how large you can have an array. However, my array SHOULD fit the "accepted" definition of size, but it does not.

I have a "header" file with all the keywords for AutoIt - I am working on something and wanted them there.

I broke them up into areas. However, a couple are over 350 elements (single dimension array).

So, what can I do to stop the error message at compile time of "unterminated string" when it can't (or maybe won't) allow all the elements?

I have attached the header file and it has the different arrays in it.

Thanks.

Oh, I do not WANT to split up the larger arrays, but that is one option I am looking at. However, splitting them up will cause me more work to do when doing a search for the element in the array(s).

Au3Keywords2.h

Link to comment
Share on other sites

  • Developers

From the helpfile:

You can use up to 64 dimensions in an Array. The total number of entries cannot be greater than 2^24 (16 777 216).

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

dickep,

Please post the code that gives you the error - your arrays are nowhere near too large.

M23

Edit: Got it! Your lines are over the max limit allowed. :)

Help file: MAX_LINESIZE 4095 Maximum size for a line of script.

Edit2: Do it like this:

#include <Array.au3>

$sFunctions =  '"abs","acos","adlibdisable","adlibenable","asc","ascw","asin","assign","atan","autoitsetoption","autoitwingettitle","autoitwinsettitle","beep","binary","binarylen","binarymid","binarytostring","bitand","bitnot","bitor","bitrotate","bitshift","bitxor","blockinput","break","call","cdtray","ceiling","chr","chrw","clipget","clipput","consoleread","consolewrite","consolewriteerror","controlclick","controlcommand","controldisable","controlenable","controlfocus","controlgetfocus","controlgethandle","controlgetpos","controlgettext","controlhide","controllistview","controlmove","controlsend","controlsettext","controlshow","cos","dec","dircopy","dircreate","dirgetsize","dirmove","dirremove","dllcall","dllclose","dllopen","dllstructcreate","dllstructgetdata","dllstructgetptr","dllstructgetsize","dllstructsetdata","drivegetdrive","drivegetfilesystem","drivegetlabel","drivegetserial","drivegettype","drivemapadd","drivemapdel","drivemapget","drivesetlabel","drivespacefree","drivespacetotal","drivestatus","envget","envset","envupdate","eval","execute","exp","filechangedir","fileclose","filecopy","filecreatentfslink","filecreateshortcut","filedelete","fileexists","filefindfirstfile","filefindnextfile","filegetattrib","filegetlongname","filegetshortcut","filegetshortname","filegetsize","filegettime","filegetversion","fileinstall","filemove","fileopen","fileopendialog","fileread","filereadline","filerecycle","filerecycleempty","filesavedialog","fileselectfolder","filesetattrib","filesettime","filewrite","filewriteline","floor","ftpsetproxy","guicreate","guictrlcreateavi","guictrlcreatebutton","guictrlcreatecheckbox","guictrlcreatecombo","guictrlcreatecontextmenu","guictrlcreatedate","guictrlcreatedummy","guictrlcreateedit","guictrlcreategraphic","guictrlcreategroup","guictrlcreateicon","guictrlcreateinput","guictrlcreatelabel","guictrlcreatelist","guictrlcreatelistview","guictrlcreatelistviewitem","guictrlcreatemenu","guictrlcreatemenuitem","guictrlcreatemonthcal","guictrlcreateobj","guictrlcreatepic","guictrlcreateprogress","guictrlcreateradio","guictrlcreateslider","guictrlcreatetab","guictrlcreatetabitem","guictrlcreatetreeview","guictrlcreatetreeviewitem","guictrlcreateupdown","guictrldelete","guictrlgethandle","guictrlgetstate","guictrlread","guictrlrecvmsg","guictrlregisterlistviewsort","guictrlsendmsg","guictrlsendtodummy","guictrlsetbkcolor","guictrlsetcolor","guictrlsetcursor"'
$sFunctions &= '"guictrlsetdata","guictrlsetfont","guictrlsetgraphic","guictrlsetimage","guictrlsetlimit","guictrlsetonevent","guictrlsetpos","guictrlsetresizing","guictrlsetstate","guictrlsetstyle","guictrlsettip","guidelete","guigetcursorinfo","guigetmsg","guigetstyle","guiregistermsg","guisetbkcolor","guisetcoord","guisetcursor","guisetfont","guisethelp","guiseticon","guisetonevent","guisetstate","guisetstyle","guistartgroup","guiswitch","hex","hotkeyset","hotkeyset","httpsetproxy","hwnd","inetget","inetgetsize","inidelete","iniread","inireadsection","inireadsectionnames","inirenamesection","iniwrite","iniwritesection","inputbox","int","isadmin","isarray","isbinary","isbool","isdeclared","isdllstruct","isfloat","ishwnd","isint","iskeyword","isnumber","isobj","isstring","log","memgetstats","mod","mouseclick","mouseclickdrag","mousedown","mousegetcursor","mousegetpos","mousemove","mouseup","mousewheel","msgbox","number","objcreate","objevent","objevent","objget","objname","opt","ping","pixelchecksum","pixelgetcolor","pixelsearch","pluginclose","pluginopen","processclose","processexists","processlist","processsetpriority","processwait","processwaitclose","progressoff","progresson","progressset","random","regdelete","regenumkey","regenumval","regread","regwrite","round","run","runasset","runwait","send","seterror","setextended","shellexecute","shellexecutewait","shutdown","sin","sleep","soundplay","soundsetwavevolume","splashimageon","splashoff","splashtexton","sqrt","srandom","statusbargettext","stderrread","stdinwrite","stdoutread","string","stringaddcr","stringcompare","stringformat","stringinstr","stringisalnum","stringisalpha","stringisascii","stringisdigit","stringisfloat","stringisint","stringislower","stringisspace","stringisupper","stringisxdigit","stringleft","stringlen","stringlower","stringmid","stringregexp","stringregexpreplace","stringreplace","stringright","stringsplit","stringstripcr","stringstripws","stringtobinary","stringtrimleft","stringtrimright","stringupper","tan","tcpaccept","tcpclosesocket","tcpconnect","tcplisten","tcpnametoip","tcprecv","tcpsend","tcpshutdown","tcpstartup","timerdiff","timerinit","tooltip","traycreateitem","traycreatemenu","traygetmsg","trayitemdelete","trayitemgethandle","trayitemgetstate","trayitemgettext","trayitemsetonevent","trayitemsetstate","trayitemsettext","traysetclick","trayseticon","traysetonevent","traysetpauseicon","traysetstate"'
$sFunctions &= '"traysettooltip","traytip","ubound","udpbind","udpclosesocket","udpopen","udprecv","udpsend","udpshutdown","udpstartup","winactivate","winactive","winclose","winexists","winflash","wingetcaretpos","wingetclasslist","wingetclientsize","wingethandle","wingetpos","wingetprocess","wingetstate","wingettext","wingettitle","winkill","winlist","winmenuselectitem","winminimizeall","winminimizeallundo","winmove","winsetontop","winsetstate","winsettitle","winsettrans","winwait","winwaitactive","winwaitclose","winwaitnotactive"'

Global $aFunctions = StringSplit($sFunctions, ",", 2)

_ArrayDisplay($aFunctions)

The include file is just so _ArrayDisplay works.

M23

Edited by Melba23

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

M23,

Using your method, it works fine. However, I have put this into a self generated file that will be read. It should be updated with each release of autoit (one would hope).

So, not sure if I have a character in the wrong place, or what.

Did you try to cut and paste into a script the first array? I did that and it fails with "unterminated string" in the line of the include file.

Not sure what is wrong.

Link to comment
Share on other sites

  • Moderators

dickep,

As I said above:

Your lines are over the max limit allowed. Help file: MAX_LINESIZE 4095 Maximum size for a line of script.

This limit is almost certainly happening in mid-word, so all the compiler sees is that there is no final quote and the poor thing throws an error.

As I suggested the solution is to break up the long lines into smaller ones and use concatenation to get a long string which is permissible (from that under-used Help file again :) )

Maximum string length: 2,147,483,647 characters

So you will have to rewrite your generation code to limit the lines to below 4095!

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

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...