Page 1 of 2

[FIXED] SC end: scope no longer taken into account

Posted: 17 Sep 2014 23:15
by pirgygab
With the last beta versions, scope of the end function seems to be not taken into account. Example:

Code: Select all

 sub "_test" ;
 msg "Still here!";

"_test"
 end 1 == 1, "Bye!", 0;
XYplorer v14.40.300: "Bye!", then ends
v14.40.0319 (and before but I don't know when that started): "Bye!" then "Still here!"

could you confirm?

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 00:23
by PeterH
Tested with what I just have:
.0300 is OK
.0311 fails.

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 00:45
by klownboy
Same here! I was wondering why a sub wasn't ending with end just yesterday.

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 01:40
by TheQwerty
Seems Don may have been a little too aggressive in fixing the usage of End within Custom Columns.

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 14:35
by klownboy
Don, sorry for the quick bump. I'm not sure if you've seen this one, but this issue really is raising havoc with number of scripts using subs.

I was at least initially unclear about the use of "1" in lieu of "0" since we want to test that the end statement ends the entire script resource file not just the script stack (i.e., the sub "_test")? I think I was reading it wrong. Because it said stack I was thinking it's the sub/label's stack. It says entire stack and the sub is just a label single script stack. Sorry for thinking out loud. From the help...

Code: Select all

end condition, [message], [scope=0]
[scope]:
0:  [default] end whole script stack                  [this meaning - entire script resource file]
1: (or any other value) end this script              [end the script - sub or label] 
In any case, whether a "1" or a "0" is the scope, the message "Still here" still appears so something's wrong.

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 15:15
by TheQwerty
klownboy wrote:In any case, whether a "1" or a "0" is the scope, the message "Still here" still appears so something's wrong.
That's correct when using '1' since 'Still Here' is in a different script than end.

Maybe this makes more sense:

Code: Select all

"A"
  Status 'Start A';
  Sub '_B';
  Echo 'Back from _B';
  Sub '_C';
  Echo 'Back from _C - I should not appear.';


"_B"
  Status 'Start _B';
  End true, 'Ending _B only.', 1;
  Echo 'End _B - I should not appear.';

"_C"
  Status 'Start _C';
  End true, 'Ending all.', 0;
  Echo 'End _C - I should not appear.';

Re: SC end: scope no longer taken into account

Posted: 18 Sep 2014 15:55
by klownboy
Thanks TheQwerty for the explanation and example. So the end is working within a script/label/sub but not for the entire script resource file that why the "End _B/C - I should not appear' works (i.e., does not appear). With the "0" scope end, 'Back from _C - I should not appear' appears, but shouldn't.

Re: SC end: scope no longer taken into account

Posted: 19 Sep 2014 17:31
by bdeshi
Don, whereare you? 14.50 contains this bug!

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 18:26
by klownboy
Hi Don, I really wish you'd take a look at this "end" behavior. As discussed above, "end" is not ending the script (i.e., the entire script resource file) in the default mode; it's only ending the individual script/label/sub. So when end (1==1) is called in a sub to actually end the entire script, instead it's returning to the where it was called and continuing...not good...getting errors in a bunch of scripts.

It also appears around the same time frame that "_Initialize" may also be misbehaving. Please see http://www.xyplorer.com/xyfc/viewtopic. ... 80#p112108 and Flux's example there. Thanks.

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 20:10
by admin
TheQwerty wrote:Seems Don may have been a little too aggressive in fixing the usage of End within Custom Columns.
Yep. I'll look into it later.

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 21:26
by bdeshi
:ninja: rather critical, this...

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 21:31
by admin
Yes, yes, upload comes tonight... :ninja:

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 21:35
by bdeshi
Sorry, didn't know "later" means "coming up" ... :ninja:

Re: SC end: scope no longer taken into account

Posted: 22 Sep 2014 21:37
by admin
Later can mean anything. :ninja:

Re: SC end: scope no longer taken into account

Posted: 23 Sep 2014 00:30
by klownboy
Scripts using end are working again...thanks Don.