I'm working with a registry value displayed on a String Meter. When the key value changes, the String meter changes.
When the key is deleted, the String meter shows "Deleted". But ... how do I know a key doesn't exists?
The String meter ALWAYS show what's inside the key. And I notice when the key is deleted, it display 0 (zero)
What this code actually does, it's hide the MeterTitle and show the meter KeyDeleted DISREGARD the condition given in IfEqualValue. In other words, it just execute the bangs every time I refresh the code, ignoring if the value is zero or not.
Perhaps IfEqualValue doesn't work as I'm thinking?
Please help.
Sorry about the bad english.
Greetings from Chile.
Last edited by Kruggernaut on June 19th, 2010, 7:39 am, edited 1 time in total.
What's happened so far:
-IfEqualValue=0 broke.
-Simplified code - didn't work
-Did a clean reinstall of Rainmeter - didn't work
-Tried removing the 'IfEqual' portion of the calc, and using the calc as a string value. THAT works.
-Tried changing 'IfEqualValue' to anything but 0 and it worked as it should.
...but we need 0 for this to work how we want it. We'll see where this goes.
Simply what that does is checking if [MeasureTitle] is smaller than 1. If it is, it prints 1 and then have the IfEqualValue act based on that. If the [MeasureTitle] is larger than 1, it will spit out 0 and it won't do squat. I think that's valid if [MeasureTitle] is not a number as well.
What's happened so far:
-IfEqualValue=0 broke.
-Simplified code - didn't work
-Did a clean reinstall of Rainmeter - didn't work
-Tried removing the 'IfEqual' portion of the calc, and using the calc as a string value. THAT works.
-Tried changing 'IfEqualValue' to anything but 0 and it worked as it should.
...but we need 0 for this to work how we want it. We'll see where this goes.
I readed how you manage to solve this problem, but didn't work for me.
I think the diference here is that you always work with numbers. My key value is a string, but 0 when deleted.
Chewtoy wrote:You could do a workaround with an if-statement.
Simply what that does is checking if [MeasureTitle] is smaller than 1. If it is, it prints 1 and then have the IfEqualValue act based on that. If the [MeasureTitle] is larger than 1, it will spit out 0 and it won't do squat. I think that's valid if [MeasureTitle] is not a number as well.
Tried that, didn't work either. It asume it's always zero.
And makes sense. Because:
When key deleted.
1.- Key deleted = 0
2.- 0 is below 1? = Yes
3.- Rainmeter: "Ok, I will execute the bangs".
When key has a value.
1.- Key value = A string containing the name of a song. "November rain"
2.- "November rain" is below 1? = ¿¿??
3.- Rainmeter: "WTF? LOL, I will return zero AND execute the bangs just to annoy you".
It seems there is no solution to me.
[EDIT] It's confirmed: When the value is a string, it will become zero automatically. So, the if statements will always asume the value is zero. I need to find another way to achieve my goal, then.
Now, if the measure is a string (which will evaluate to 0) nothing happens. The substitute turned the 0 from your original measure into -1 which will make the bangs fire.
Hope this works for you.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
And use the 2nd one for values, the first one to display the data, if you wish.
Edit: Nevermind, you probably won't know the text that the registry will give you so the substitute won't work.
Substitutes do not work in meters, only measures.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
Have you tried that code? It doesn't work for me. It only works if I change "IfEqualValue=-1" to "IfEqualValue=0". (Just that line)
There are three options:
1.- If the code works for you, then I have something wrong in my code.
2.- A string containing a number cannot be parsed.
3.- A deleted registry key returns something like "null", or something ... But it gets represented by zero when displayed on a string meter. That could be the reason behind the Substitute failure.
By the way, I already thougt about using substitute before ... but what if the song name contains a 0? I have a lot of songs who have zeros on the name. The output for songs like "Atv 2009" will look like "Atv 2-1-19"