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


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

Posts: 1,289
Registered: 14-Dec-2007
level cannot be used in init.bsh?
Posted: 3 Dec 20, 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: 471
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 3 Dec 20, 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: 471
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 3 Dec 20, 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,289
Registered: 14-Dec-2007
Re: level cannot be used in init.bsh?
Posted: 3 Dec 20, 17:13   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Thanks!
ctwist

Posts: 471
Registered: 27-Sep-2003
Re: level cannot be used in init.bsh?
Posted: 3 Dec 20, 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