Jump to content

Array usage / Empty Array / _ArrayAdd()


texan
 Share

Recommended Posts

I am a little confused on how to best manage an array. There doesn't appear to be a way to have an empty array, that is, an array with no elements. If I try to define the array as:

Dim $Array[]    or
Dim $Array[0]
the code will not compile.

So I start out defining the array as

Dim $Array[1]
The problem with defining the array like this is that it leaves a single blank value in the array. When I use the _ArrayAdd() UDF the blank value in the array always remains and the array appears to have one more item then desired. I don't see how you can use _ArrayADD without this occuring.

What am I missing?

Link to comment
Share on other sites

  • Moderators

texan,

You are not alone.! Enjoy the read! :x

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

M23, thanks again. That clears that up.

Now, on a side note, I was a little puzzled why your linked post didn't show in my search results when I did a search of all forums for "empty array". That other forum post was titled "Declaring an empty array", you think that would show near the top of the search results. But, what I realized now is that the search results are displayed based on Last Update Time, Title(alphabetically), Number replies or Views. There doesn't appear to be anything to display the search results based on relevance. I did a google search using "empty array site:autoitscript.com/forum/" and that post was second in the list so I will use google from now on to search instead of the built in search.

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