This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Pages: 1 - Last Post: 03-Dec-2020 19:00 Last Post By: ctwist Threads: [ Previous | Next ]
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
level cannot be used in init.bsh?
Posted: 03-Dec-2020 14:43
 
  Click to reply to this thread Reply
With this simple code in init.bsh:
boolean folderAlbum;
folderAlbum = (level>0);
I get an error message:
illegal use of undefined variable, class, or 'void' literal : at Line: 23

Why???
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 03-Dec-2020 15:58   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
level is only available when iterating.
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 03-Dec-2020 16:18   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Try this.
List<AlbumObject> vChildren = rootfolder.getChildren();
for (AlbumObject vAO : vChildren)
{ if (vAO.isFolder())
  { folderAlbum = true;
    break;
  }
}


Edited by: ctwist on 03-Dec-2020 10:19
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
Re: level cannot be used in init.bsh?
Posted: 03-Dec-2020 17:13   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Thanks!
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 03-Dec-2020 19:00   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
You may want to ignore excluded folders:
if (vAO.isFolder() && vAO.isIncluded())
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums