Hi,
I've been working (more like playing) with the theme.xys script (binocular222's version) from this thread http://www.xyplorer.com/xyfc/viewtopic. ... 90#p100942. I'm attempting to save the selected theme as a perm variable so the "current" theme can be flagged in the script's theme dropdown selection. The problem is the script has to "exit without saving" (#190) at the end in order to restart with the newly selected theme. So setting the variable as perm doesn't work unless I specifically "save all settings" using Command ID #182 after declaring the perm variable (e.g., perm $p_Menu = "$Menu"; #182;). Saving just he configuration, #193 doesn't save the permanent variables to pv.dat. It only saves XYplorer.ini settings.
Anyone know of a way to simply save the perm variable(s) as in the case above where the script exits without saving without resorting to saving the entire configuration (#182) or possibly, there's some other way to accomplish what I'm after.
Thanks,
Ken
Saving a perm variable in a script which exits w/o saving
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
-
highend
- Posts: 14954
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Saving a perm variable in a script which exits w/o savin
Hi Ken,
never tried that script. Why not saving anything permanent in an .ini file instead? eval() helps you to get the content of any stored variables in such a file.
never tried that script. Why not saving anything permanent in an .ini file instead? eval() helps you to get the content of any stored variables in such a file.
One of my scripts helped you out? Please donate via Paypal
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Re: Saving a perm variable in a script which exits w/o savin
You can use writepv.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Saving a perm variable in a script which exits w/o savin
Writepv worked fine and fast. Thanks Marco. I figured there had to be something to save a perm variable without saving everything which may not be desired. I searched the forum but should have searched the help file in more detail.
Thanks highend, I'll have to look further into the use of "eval" and storing the variable in an ini file. I'm not sure yet if I can store the variable within the selected or current "ini" theme file without creating issues and of course then I'd have to get that information to be able to use it in the popupmenu or inputselect.
The use of XY themes in the mentioned thread is actually quite nice once you create or modify your themes to your personal liking.
Thanks,
Ken
Thanks highend, I'll have to look further into the use of "eval" and storing the variable in an ini file. I'm not sure yet if I can store the variable within the selected or current "ini" theme file without creating issues and of course then I'd have to get that information to be able to use it in the popupmenu or inputselect.
The use of XY themes in the mentioned thread is actually quite nice once you create or modify your themes to your personal liking.
Thanks,
Ken
-
SkyFrontier
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: Saving a perm variable in a script which exits w/o savin
Themes saved in v2 format using the Theme Tool Creation and Management will generate a '<xydata>\z_XYstylEZ_CurTheme.txt' file which identifies current theme - but this info needs to be read externally, of course (has a helper for this, already in the Tool set).
*Also* (this may help you more), a theme saved in v2 format will contain its name inside the script structure, so you could (by a complicated template approach) read the script into a variable, which in turn could provide the means to need to achieve what you want, the way you describe.
As I have to
-load each theme again,
-adjust some minor color issues,
-save them using the tool (adding internal/external names),
-and finally rebuild the theme set again
and had no time yet for this, I can't do it for you. But... helping me would help you, I guess.

A v1 > v2 > v1 conversion tool is planned, but yet on the blueprints.
The theme set + theme tools were just a kick off.
*Also* (this may help you more), a theme saved in v2 format will contain its name inside the script structure, so you could (by a complicated template approach) read the script into a variable, which in turn could provide the means to need to achieve what you want, the way you describe.
As I have to
-load each theme again,
-adjust some minor color issues,
-save them using the tool (adding internal/external names),
-and finally rebuild the theme set again
and had no time yet for this, I can't do it for you. But... helping me would help you, I guess.
A v1 > v2 > v1 conversion tool is planned, but yet on the blueprints.
That's the idea!klownboy wrote: The use of XY themes in the mentioned thread is actually quite nice once you create or modify your themes to your personal liking.
The theme set + theme tools were just a kick off.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Saving a perm variable in a script which exits w/o savin
Hey SkyFrontier,
I haven't really dabbled with your version too much yet. I've been playing with the binocular222 version (theme.xys). I actually like the simplicity of that version as I had mentioned earlier in your script thread (i.e., simply using "ini" files for the different theme data). What is of utmost importance to me though is changing/loading themes as quickly as possible and I think it would be for everyone interested in themes. The rest is great but fluff. I feel bad in saying that because I've looked at your scripts and all the associated theme management tools and can tell you've put in a significant amount of work.
All I wanted, and have since accomplished with the help here, was to be able to flag or indicate on the popupmenu which is the current theme and also indicate this on the "save as" dialog box (i.e., displays as the current theme as the default which makes it easier to save the current theme). Next I want to add the theme deletion capability to the menu.Nice work SkyFrontier, your script may win me over yet!
Thanks,
Ken
I haven't really dabbled with your version too much yet. I've been playing with the binocular222 version (theme.xys). I actually like the simplicity of that version as I had mentioned earlier in your script thread (i.e., simply using "ini" files for the different theme data). What is of utmost importance to me though is changing/loading themes as quickly as possible and I think it would be for everyone interested in themes. The rest is great but fluff. I feel bad in saying that because I've looked at your scripts and all the associated theme management tools and can tell you've put in a significant amount of work.
All I wanted, and have since accomplished with the help here, was to be able to flag or indicate on the popupmenu which is the current theme and also indicate this on the "save as" dialog box (i.e., displays as the current theme as the default which makes it easier to save the current theme). Next I want to add the theme deletion capability to the menu.Nice work SkyFrontier, your script may win me over yet!
Thanks,
Ken
To see the attached files, you need to log into the forum.
XYplorer Beta Club