Jump to content

Variable cannot be accessed in this manner


Apophus
 Share

Recommended Posts

I'm scratching my head raw trying to figure out what I'm doing wrong in the short script below causing the "Variable cannot be accessed" error

#Include <File.au3>
#Include <Array.au3>
$idir = "D:\LittleOne Music\My IPOD"

;             Get list of sub-folders in $idir

$FolderList=_FileListToArray($iDir)
$edl = $FolderList[0]


;             $edl = number of sub-folders in $idir

;             Now get a list of the files in each sub-folder - set $mdir to the name of the $dix(nth) sub-folder

For $dix = 1 To $edl
   $mdir = $FolderList($dix)
   $FileList=_FileListToArray($mdir)              ==> Variable cannot be accessed in this manner.

Next

 

Link to comment
Share on other sites

  • Moderators

Welcome to the forum. In short, your issue is you have no error checking. I see the likely issue, but this is a good learning opportunity. Does $mdir return what you would expect it to?

Edit: Or forget the whole "Teach a Man to Fish" motto 😄

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

On 11/24/2020 at 12:44 PM, Danp2 said:

Change the parentheses to square brackets and it should work. 😎

Thank you. I was mistakenly sure that parentheses were the proper symbols to enclose a subscript. Hard to tell the difference on my laptop. I also didn't place the error message on the correct line; should have been on $mdir = $FolderList($dix) .

 

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