Jump to content
Sign in to follow this  
swoop

Why Does UBound Not Work in This Array Case?

Recommended Posts

swoop

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
JohnOne

You have a string in the timeout param
 

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

Local $fileList = _FileListToArray("C:\", "*.*")

MsgBox (0,Default,UBound($fileList))
_ArrayDisplay ($fileList)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.