It is currently May 3rd, 2024, 12:09 pm
Variables as .inc statements...?
-
- Posts: 146
- Joined: January 8th, 2011, 7:12 pm
- Location: Tennessee
Variables as .inc statements...?
I have a menu skin that uses a Programs.inc file to list the contents of my menu... Now, with the ability to use the scroll wheel to trigger bangs, I thought it would be cool to use the mouse scroll to toggle through multiple possible menus, in other words, maybe have a Programs1.inc, a Programs2.inc and perhaps a Folders.inc etc. Which would mean a !bang that would change which @include to... well.. include, for each click of the mouse wheel. };] But I don't think it is possible to make an @Include a variable, correct? Nor can I see a way to use !WriteKeyValue to change which @Include to use... Understand? Or did I just loose you all? };]
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Variables as .inc statements...?
You can do both of those things. You can use a variable in an included file path, as long as the variable is defined "before" the statement:
Or you can use !WriteKeyValue to change the file path:
(Replace "Section" with whichever section contains the statement, e.g. "Rainmeter", "Variables", etc.)
Code: Select all
[Variables]
MyIncludeFile=Programs1
@include=#MyIncludeFile#.inc
Code: Select all
[!WriteKeyValue "Section" "@include" "Programs1.inc"]
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Variables as .inc statements...?
Interesting idea... hope you'll share what you come up with!CybOrSpasm wrote:I have a menu skin that uses a Programs.inc file to list the contents of my menu... Now, with the ability to use the scroll wheel to trigger bangs, I thought it would be cool to use the mouse scroll to toggle through multiple possible menus, in other words, maybe have a Programs1.inc, a Programs2.inc and perhaps a Folders.inc etc. Which would mean a !bang that would change which @include to... well.. include, for each click of the mouse wheel. };] But I don't think it is possible to make an @Include a variable, correct? Nor can I see a way to use !WriteKeyValue to change which @Include to use... Understand? Or did I just loose you all? };]
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 146
- Joined: January 8th, 2011, 7:12 pm
- Location: Tennessee
Re: Variables as .inc statements...?
@eclectic-tech:Interesting idea... hope you'll share what you come up with!
If I get something to work, I will gladly post the code. I would share my whole layout, but the problem is that it is rather computer specific... Oddball resolution of 1280x768 etc.. Perhaps I will re-write just one of the "slide show" pictures so people can at least tear it apart to see how it works. };]