It is currently May 6th, 2024, 9:38 pm

Calc measure rejecting numerically converted measure

Get help with creating, editing & fixing problems with skins
sea1monkey2
Posts: 28
Joined: April 21st, 2010, 4:03 am

Calc measure rejecting numerically converted measure

Post by sea1monkey2 »

I am working on an automatic weather skin that changes your location automatically when you change location based on IP. I have everything set up and running except for the automatic changer. For some reason, the output of the weather code (XXXX####) with the letters substituted out is being turned down by any calc measures that i try to send it to. Anybody have any suggestions?

Code: Select all

[mCodeAlt]
Measure=Plugin
Plugin=Plugins\WebParser.dll
;URL=[mCodeFetch]
URL=http://www.ip2location.com/
RegExp="(?siU).*<label for="chkWeather">.*<label for="chkWeather">.* (.*)</label>.*"
StringIndex=1
Substitute="(":"",")":"","A":"","B":"","C":"","D":"","E":"","F":"","G":"","H":"","I":"","J":"",

"K":"","L":"","M":"","N":"","O":"","P":"","Q":"","R":"","S":"","T":"","U":"","V":"","W":"","X":

"","Y":"","Z":""
UpdateRate=900
Disabled=0

[mCodeSwap]
Measure=Calc
Formula=mCodeAlt
DynamicVariables=1
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Calc measure rejecting numerically converted measure

Post by smurfier »

In order to use the substituted dynamic value of the measure, you need to surround the measure name in brackets. Surrounded in brackets the measure attempts to use the string value, which is the only value that Webparser provides.

Code: Select all

[mCodeSwap]
Measure=Calc
Formula=[mCodeAlt]
DynamicVariables=1
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 . . .
sea1monkey2
Posts: 28
Joined: April 21st, 2010, 4:03 am

Re: Calc measure rejecting numerically converted measure

Post by sea1monkey2 »

errr... ummm... this is embarrassing, i though i already tried that. Thanks!
sea1monkey2
Posts: 28
Joined: April 21st, 2010, 4:03 am

Re: Calc measure rejecting numerically converted measure

Post by sea1monkey2 »

Thanks again for the help smurfier. I have another small bug, whenever i run the measure this measure, i get an error reading "Calc: Extra operation in [mCodeSwap]".

Got anything on this one?

Code: Select all

[mCodeSwap]
Measure=Calc
Formula=[mCodeAlt]<>#WeatherAlt#
IfAboveValue=0
IfAboveAction=!Execute [!WriteKeyValue Variables WeatherAlt [mCodeAlt]][!WriteKeyValue Variables WeatherLocation [mCodeFetch]][!Refresh]
DynamicVariables=1
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Calc measure rejecting numerically converted measure

Post by smurfier »

I'm going to guess that the mCodeAlt is returning a non-number character that is normally valid in a calc statement.
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 . . .
sea1monkey2
Posts: 28
Joined: April 21st, 2010, 4:03 am

Re: Calc measure rejecting numerically converted measure

Post by sea1monkey2 »

Bingo, thanks again :D

your reward is a sneak peek of the skin

Image
(it's already slightly cleaner than that)