I want to ask the skin, does a string contain any letters? No? Then set the variable to 0. If it does, set the variable to 1. Easy enough to do this with just numbers, but I need to know if a particular measure if giving me words or is giving me a dummy string.
Straight up? Is there no way to ask if a string has a value, or not? Like a true or false type-deal?
I have a plugin that stores 20 strings in a table. It stores 20 strings even if 10 of those strings are blank, but if you were to ask the plugin how many strings it has, it will always say 20.
Last edited by Virginityrocks on May 19th, 2012, 4:41 pm, edited 1 time in total.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
Virginityrocks wrote:Straight up? Is there no way to ask if a string has a value, or not? Like a true or false type-deal?
Nope. You would need to jump out to Lua to do string comparisons, unless you use a Substitute on a measure returning a string to turn string values into numbers.
OOOOkay. I think I understand now. It's kind of strange that, even though the number is still part of a string, it's still recognized as a number. I think programming Rainmeter to accept strings as values for formulas would be a good addition to future versions of the program.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
Alright, so now that I have that sorted out, it causes a new problem.
Since I've substituted all of my blank strings with 1 (Substitute="":"1") in order to calculate the total number of blank strings by adding each 1 together, now each blank string is shown as 1. For example, my output might be:
4walled
Facebook
Google+
1
1
1
1
1
I want to remove the 1s from the string immediately after the value is calculated, and before the string is written.
I have tried using !SetOption Strings Text "", but that doesn't do anything.
I have also tried setting it to something else, but that doesn't solve the problem, it just changes 1 to some other visible entity.
Is there a character that I can use in !SetOption Strings Text "" that rainmeter will not display if I place it in the editor? Like a double slash, or some other combination of characters that do not display if written?
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
I saw that you wrote that but I don't understand what you mean by duplicate.
Also, I just want to make a note that RegExpSubstitute causes Rainmeter to crash when I place it in the field you've written. I'm not sure if that is necessary for this function.
Last edited by Virginityrocks on May 20th, 2012, 5:21 pm, edited 1 time in total.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter