|
Global vs Window variables... 1 Year, 2 Months ago
|
|
|
I apologize if this thread is in the wrong place, I'm just not sure where it really goes. Feel free to move it if need be.
Anyway, I'm wondering when I create some variables they automatically become Global variables and others remain Window variables?
Is there a way I can set the variable type myself rather than letting the program do it?
Thanks for any and all help.
|
|
Mirage
Junior Boarder
Posts: 26
|
|
|
|
|
Re: Global vs Window variables... 1 Year, 2 Months ago
|
|
|
The variable type depends on if you define the window for it or not. If the variable is set to a specific window it is shown only for it. If the window is not defined the variable will be global.
|
|
Rainy
Moderator
Posts: 5397
|
|
|
|
|
Re:Global vs Window variables... 1 Year, 2 Months ago
|
|
|
Ah, that makes sense now that I look at it more closely. Now my problem is, when I change the code below, by simply adding the "window=" to the Skin.xml file as shown below:
Skin.xml
<variable name="Digital_Clock_fontsize" default="60" window="Digital Clock" description="Set the font size of the Digital Clock." />
Elements.xml
<font id="font.clock" facename="Ariel" size="%Digital_Clock_fontsize%" />
Digital Clock.xml
<time x1="10" y2="10" align="TOP-LEFT" element="font.clock" color="%Digital_Clock_color%" effect="BORDER" format="%Format%" timezone="%Timezone%" DST="1"/>
The font size does not change, and I now get an error that says "ERROR: Illegal use of binary operator at pos 0 in expression "%Digital_Clock_fontsize"
I'm not really sure what I'm doing wrong. Could somebody please explain?
Thanks much
Glenn
|
|
Mirage
Junior Boarder
Posts: 26
|
|
|
|
|
Re:Global vs Window variables... 1 Year, 2 Months ago
|
|
|
Do you see ?
Variable %Digital_Clock_fontsize% is used in elements.xml, rather than used in Digital_Clock.xml, so you don't need specify the window="", just like this:
skin.xml
<variable name="Digital_Clock_fontsize" default="60" description="Set the font size of the Digital Clock." />
|
|
|
|
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com

|
|
|
Re:Global vs Window variables... 1 Year, 2 Months ago
|
|
|
Right, I understand that part. But leaving the window= off will make it a global variable which is what I'm trying to avoid. So following that logic, I should be able to change Digital Clock.xml to look like this:
Digital Clock.xml
<time x1="10" y2="10" align="TOP-LEFT" facename="Ariel" Size="%Digital_Clock_fontsize" color="%Digital_Clock_color%" effect="BORDER" format="%Format%" timezone="%Timezone%" DST="1"/>
correct? Let me give that a shot and see what happens.
But your input and comment anoob, are always welcome. This is all just a learning experience for me. And a lot of fun.
Thanks
|
|
Mirage
Junior Boarder
Posts: 26
|
|
|
|
|
Re:Global vs Window variables... 1 Year, 2 Months ago
|
|
|
Right now, if you wish to change font size, you must set a global variable to do it.
Note: is "%Digital_Clock_fontsize%", not "%Digital_Clock_fontsize" (lost '%')
|
|
|
|
Last Edit: 2012/04/15 13:21 By anoob.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com

|
|
|