Variables in .rc files. Thread last updated on 2006-04-19 03:15:30

Posted by member 206039 on 2006-04-19 02:12:20

I just downloaded a new theme and its font was rediculously tiny on my screen. I opened up theme.rc and found every spot where it said "...FontHeight" and changed it from 8 to 14. After changing six or eight values I started to wonder why the author didn't make some sort of font height variable and stick it near the beginning so I could change it once and fix everything. Is it possible to make a local variable in a .rc file? Are there any reasons not to? I've not had much experiance (read: i'm a noob) beyond toying with already created themes so go easy on me :P

Posted by member 212670 on 2006-04-19 02:50:32 link

Before any "...FontHeight" entry, stick in something like...

FontSize 14

...on its own line.

Then, each "...FontHeight" line could be...

...FontHeight $FontSize$

Then, all you have to do is change the value for FontSize.

Posted by member 206039 on 2006-04-19 02:53:34 link

I found my answer with more toying. I hope people read this and remember that its good practice to make a variable to stand for values you use repetedly. It makes tweaking things easier. My next question is about math in the .rc files. I'll probably answer it myself in a few more minutes but it can't hurt to sort of think out loud. Are math or logical operations alowed in .rc files? can I make something like a height variable "ThingyY" and something else "ThingyY / 2" or ".5 * ThingyY"?

p.s thanks xcal.

Posted by member 212670 on 2006-04-19 02:57:29 link

OptionOne 25
OptionTwo $OptionOne+50$
OptionThree $OptionTwo/OptionOne+5$

OptionTwo's value is then 75.
OptionThree's value is then 8.

Posted by member 206039 on 2006-04-19 03:15:30 link

Oh inside the $! That does it! Thanks again!