If foreach has an empty list, and MsgOnEmpty is specified, XY says that 1st parm is invalid. This is definitely wrong.
Example script: 2 foreach run OK, 3rd & 4th show error. (Click Continue!)
(In real situation the list is a list of files, that can be empty.)
And maybe: a misunderstanding. What *should* MsgOnEmpty really do? And what should happen to the 'returned' var ($v) in this case?
(My expectations seem to be wrong... )
Bug on foreach with empty list & MsgOnEmpty
Bug on foreach with empty list & MsgOnEmpty
- Attachments
-
- $tForeach.xys
- (842 Bytes) Downloaded 14 times
Win11 Pro 223H2 Gerrman
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Bug on foreach with empty list & MsgOnEmpty
Confirmed, that's a bug (born 20220816). Fix comes.
FAQ | XY News RSS | XY Twitter
[solves] Bug on foreach with empty list & MsgOnEmpty
Bug is gone
Thanks!
Now it still doesn't do what I expected. But what help documents.
No problem: I only wanted to use it because I misunderstood. Now it's easy to check for an empty list before the foreach.
So: all is fine again
Thanks!
Now it still doesn't do what I expected. But what help documents.
No problem: I only wanted to use it because I misunderstood. Now it's easy to check for an empty list before the foreach.
So: all is fine again
Win11 Pro 223H2 Gerrman