Sign in to follow this  
Followers 0
swoop

Why Does UBound Not Work in This Array Case?

2 posts in this topic

When I try to get the value of UBound ($fileList), it doesn't return any value.

However, when I use _ArrayDisplay, I see there are many items, and the [0] element contains the count.

#Include <File.Au3>
#Include <Array.au3>

Local $fileList = _FileListToArray("C:\", "*.*", 1, True)
MsgBox (0,Default,"Files: ", UBound($fileList))
_ArrayDisplay ($fileList)

Is there a way to count the array returned by _FileListToArray?

But what's strange, is that the following code does run fine. It returns 5 for Ubound.

#Include <Array.au3>    

Global $arrayTest1 = [2,"n","c"]
Global $arrayTest2 = [2,"a","b"]

_ArrayConcatenate($arrayTest1,$arrayTest2,1)

_ArrayDisplay ($arrayTest1)
msgBox (0,Default,Ubound($arrayTest1))

Am I doing something wrong in these two cases?

Share this post


Link to post
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
Sign in to follow this  
Followers 0