Page 1 of 1

Bug on foreach with empty list & MsgOnEmpty

Posted: 29 Mar 2023 14:45
by PeterH
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... :whistle: )

Re: Bug on foreach with empty list & MsgOnEmpty

Posted: 29 Mar 2023 18:28
by admin
Confirmed, that's a bug (born 20220816). Fix comes. :tup:

[solves] Bug on foreach with empty list & MsgOnEmpty

Posted: 29 Mar 2023 21:56
by PeterH
Bug is gone :tup:
Thanks!

Now it still doesn't do what I expected. But what help documents. :oops:
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 :beer: