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

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
pirgygab
Posts: 25
Joined: 05 Feb 2013 23:07

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

Post 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?
Last edited by pirgygab on 23 Sep 2014 22:42, edited 1 time in total.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: SC end: scope no longer taken into account

Post by PeterH »

Tested with what I just have:
.0300 is OK
.0311 fails.

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC end: scope no longer taken into account

Post by klownboy »

Same here! I was wondering why a sub wasn't ending with end just yesterday.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: SC end: scope no longer taken into account

Post by TheQwerty »

Seems Don may have been a little too aggressive in fixing the usage of End within Custom Columns.

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC end: scope no longer taken into account

Post 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.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: SC end: scope no longer taken into account

Post 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.';

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC end: scope no longer taken into account

Post 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.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: SC end: scope no longer taken into account

Post by bdeshi »

Don, whereare you? 14.50 contains this bug!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC end: scope no longer taken into account

Post 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.

admin
Site Admin
Posts: 66634
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC end: scope no longer taken into account

Post 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.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: SC end: scope no longer taken into account

Post by bdeshi »

:ninja: rather critical, this...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66634
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC end: scope no longer taken into account

Post by admin »

Yes, yes, upload comes tonight... :ninja:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: SC end: scope no longer taken into account

Post by bdeshi »

Sorry, didn't know "later" means "coming up" ... :ninja:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66634
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC end: scope no longer taken into account

Post by admin »

Later can mean anything. :ninja:

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC end: scope no longer taken into account

Post by klownboy »

Scripts using end are working again...thanks Don.

Post Reply