[MeasureAllowance]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureABB]
StringIndex=3
[MeasureAllowanceNonZero]
Measure=Calc
Formula=MeasureAllowance
RegExpSubstitute=1
Substitute="^0$":"0.000001"
[PercentUsedData]
Measure=Calc
;For plans that are NOT unlimited, allow proper calculation of % remaining by removing below comment
Formula=Round(((MeasureTotalUsed / [MeasureAllowanceNonZero]) / 10000 ),2)
;For UNLIMITED plans, use a NOMINAL 1000gb limit by removing below comment
;Formula=Round((MeasureTotalUsed / 10000000000 ),2)
DynamicVariables=1
This worked though.....
As I said previously, the string is being read from a text file (Originally I was converting to GB but removed that to use the raw values)..... It's downloaded directly from my ISP in xml and is never zero.
Maybe the file is blank when it's first trying to execute the skin? (and therefore zero and divide by zero)?
Can I put a delay in so it waits for the file to be updated before showing the skin?
You could disable the [PercentUsedData] measure, then add a FinishAction to the webparser measure that enables that measure and updates it.
Add Disabled=1 to the [PercentUsedData] measure.
Then add FinishAction=[!EnableMeasure PercentUsedData][!UpdateMeasure PercentUsedData] to the [MeasureABB] webparser measure.
This will not try to divide the MeasureTotalUsed until the webparser has finish reading the file and populating the child measures.
Disable the [PercentUsedData] measure (by adding a Disabled=1 option to it).
Enable the measure, once the WebParser measure got the appropriate values. This can be done by adding a FinishAction=[!EnableMeasure "PercentUsedData"] option to the [MeasureABB] measure.
Seem to me that there is another pretty straightforward way to avoid all "divide by zero" and "extra operation" errors, [SectionVariabls] and DynamicVariables in this:
The long and the short of it is that any WebParser measure has an initial value of "" (an empty string) when it is first loaded and before it has gone out to get data the first time. Since WebParser is "threaded" and doesn't cause Rainmeter to wait around for it, on the first skin update, all WebParser measures will always have a value of "".
Any "math" done on this will at best be irrelevant, and at worst create a formula that can't exist in an Einsteinian universe, like dividing something by "", or adding "" to "" and dividing that by 2. One option is to not set those formulas until there is actual data to work with, which will be when the WebParser measure is "finished" for the first time.