Script file does not contain any visible scripts?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Script file does not contain any visible scripts?

Post by klownboy »

As of this morning and revision 14.40.0311, I started receiving error messages on some scripts run from a CTB which ran fine yesterday and many months before. It's always the same thing.

Code: Select all

Script file 'D:\Tools\XYplorer\Scripts\XYmenu.xys' does not contain any visible scripts.
load
D:\Tools\XYplorer\Scripts\XYmenu.xys
If I select an menu item, it will run fine, but I'll receive this error at the completion. I'll also receive it if I click out of the menu instead of selecting a menu item. I've been stepping through the script to see if I can catch what's going on. Anyone else experiencing any similar problem with a menu type CTB? I didn't want to post in "Bug Reports" until I investigate further. Thanks.

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

Re: Script file does not contain any visible scripts?

Post by klownboy »

Wow, no one is experiencing any issues with a CTB scripted menu that use heredoc along with nested heredoc sub menus or anything may be related to that. I just cranked up my laptop and it doing the same thing. The menu worked fine on V14.40.0309 and when I updated to 14.40.0311 it stopped working just like my desktop. I'm getting the error message described in my first post.

Don, I know you were working / changing some issues with CC variables / returns. Could that in some way have affected a menu script using a perm variable heredoc. The heredoc itself is made perm variable until the script is terminated in "_Terminate". The behavior has been the menu item will work but I'll receive the above mentioned error and I'll also receive it if I click out of the menu. I had no issues once so ever with this script for over a year until 14.40.0311 and now on 2 machines. Thanks for any help.

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

Re: Script file does not contain any visible scripts?

Post by klownboy »

I think I've figured it out and fixed the issue on both computers. There appears to be a slight difference in how "_Initialize" is handled in that the remainder of the Menu type scripts (see below for example) was handled as if it was part of the "_Initialize" and not the menu so I was getting the "no visible scripts error". I don't know what could have changed in XY (v14.40.0311) that caused it because I didn't change anything and it occurred on 2 machines.

Code: Select all

"_Initialize";
   perm $script = self(file);
   perm $mn =<<<FOO
"AllwaySync|D:\Tools\Allway Sync\Bin\Syncappw.exe" open "D:\Tools\Allway Sync\Bin\Syncappw.exe";
"Ccleaner|<xyicons>\ccleaner02.ico" open "D:\Tools\Ccleaner\Ccleaner.exe";
"Control panel|C:\Windows\System32\shell32.dll /22" #640;
"Customized File Icons|:cfi" #653;
bla, bla bla...
In this particular case and in 2 additional scripts, eliminating the "_Initialize" seems to have solved the problem. It wasn't necessary to use it here, but why the change in behavior? I'm wondering for other cases using "_Initialize" if there may be issues. Thanks.

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: Script file does not contain any visible scripts?

Post by FluxTorpedoe »

Hi'
:bug: confirmed.
Belatedly I'm afraid, but I'm really short on time these days, so I was off the forums and missed several XY betas…
Edit: and I missed relevant posts as Ken pointed out below…
It broke several of my scripts too and took me a bit to figure it out (or at least it's related):
Main scripts are now processed whatever happens in "_Initialize" —including "end".

Up until XY v14.30, the following code displayed "initialize" in the status bar, whereas in v14.50 it displays "main" (i.e. "end" command is now considered local).

Code: Select all

"_Initialize"
  status "initialize";
  end 1;

"Main"
  status "main";
Did a quick browse of the changelogs but didn't see what could have caused this… Hope it won't be too much trouble! :)

Have a nice day anyway, 8)
Flux
Last edited by FluxTorpedoe on 20 Sep 2014 10:37, edited 1 time in total.

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

Re: Script file does not contain any visible scripts?

Post by klownboy »

Hi Flux, I thought something was messed up. In one particular case I sited above, I really didn't need the "_Initialize" so by deleing it, that specific problem went away, but it looks like it could be a bug. Though in your case if you put a wait 500 after the status initialize statement you will see "initialize" flash, but like you said, end is not ending it.

Did you also see the post on end being hosed up http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=12525. With the default "0" scope, it should end the entire script (resource file) but it does not - it always acts in the end individual script label / sub scope of "1".

Don, could you take a look at this "_Initialize" and "end" behavior change? Thanks.

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: Script file does not contain any visible scripts?

Post by FluxTorpedoe »

Thanks Ken for pointing out the relevant thread…
My bad for the dupe :bug: alert, I missed it cause I was focused on an "_Initialize" problem only.

Post Reply