Jump to content

Why Does UBound Not Work in This Array Case?


Recommended Posts

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?

Link to comment
Share on other sites

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.

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