It is currently December 7th, 2022, 11:28 pm

String Comparisons

Report bugs with the Rainmeter application and suggest features.
Culture
Posts: 6
Joined: August 14th, 2009, 8:37 am

String Comparisons

Post by Culture »

G'day,

Been using RainMeter for some time now and having a ball with it (just upgraded to 1.0 and twisting my brain with Transformational Matricies...back to Uni days...YAAYYYY!!!!). However, one function that I do miss is the ability to convert a string value into a numeric value. I've had a look on the forums and not found anything akin to it (domestic blindness aside).

I've tried to accomplish this with the Substitute clause, but have since discovered that this only changes the display value rather than the actual value so I now know why my meters failed dismally in that respect, as have other alternatives.

So, as a for example, one of the things I'd like to do is display the wind direction in a ROUNDLINE meter based on a number ranging 'tween 0 to 15 where N = 0 (top of the meter) clockwise around to NNW = 15. This would allow me to highlight (with the subsequent use of the CALC function) a portion of the meter that corresponds to the wind direction (perhaps even with the value of the windspeed).

So, unless this can be accomplished some other way (which'd be great!!..and this could be reposted elsewhere), I'm thinking of something that's pretty much identical to the format of the CALC function but the Formula clause tests a string instead. For example;

[MeterStringConvert]
Meter=SCONVERT
Formula=(MeasureStringValue = "N") ? 0 : (MeasureStringValue = "NNE") ? 1 : <and so on...>

Thus, the value of MeterStringConvert can be used in subsequent CALC functions or Meters. Anyway food for thought...

Cheers
Culture