What I'm trying to achieve is a skin which shows the division standings in the NFL - but I only want to show one division at a time, and to change what's shown by clicking on the skin. I've found a page on ESPN that works, parsed it correctly (thank you RainRegExp!) and have a skin that displays the first league from that page (happens to be the NFC East). So far, so good.
Here's where it gets funky. To display the NFC East I use measures calling string indices 1-21 (seems like a lot, but the page shows team name, wins, losses and draws as individual entries). To display the next division, I will need to use 22-42 - and so on, with there being eight sets in total. Here are my thoughts (in order of desirability):
1) What I'd like to do is define a variable (say "League") which would be the first number in that range (i.e. 1, 22 and so on). I'd then define 21 other variables which would be TopTeamName=#League#+2 etc., then my WebParser measures would use those variables in the StringIndex= statement. Somewhere else in the skin I'd then have an action that calls RainmeterSetVariable, set #League# to a different number (probably by way of a second variable and a Calc measure, to make it loop back to 1 after eight clicks) and everything flows through from that.
Having been reading around this idea, I don't think it works. Reason 1 - the manual says that WebParser can't use Dynamic Variables, which is what the RainmeterSetVariable command needs, right? It doesn't make any difference that the variable I'm setting isn't actually the one that WebParser is reading - it's changing while the skin is running, therefore it's a dynamic variable, therefore WebParser can't use it. Right? Reason 2 - Alex's post in this thread says that if you define a variable by reference to another variable, the latter (say #TopTeamName# in my example above) will only ever take the initial value of the former (#League#). So even if #League# changes from 1 to 22, #TopTeamName# always stays at 3. Is all of this right? If it is, is there some workaround/clever way I haven't spotted to achieve this? Because it seems to me to be the neatest way.
2) If I can't do it as a set of 22 measures with varying StringIndices, I guess I have to do it by show/hide skins. The easiest way to do that, to my mind, would be if I can still define the 22 variables - then just save the same .ini eight times in the same folder (with different titles) and all I have to change in each skin is the #LEAGUE# variable. Then I can set up the skin to show/hide the relevant variants as needed (although if I go this route I'll probably make eight buttons, one for each variant, rather than cycling).
From the thread I've referred to above, this SHOULD work shouldn't it? Even though it's defined by reference to another variable, this isn't a dynamic variable (therefore WebParser should recognise it) and none of the variables will change so it's okay that they're fixed with the first value. I've tried this route, though, and I can't make it work - when I put in the [variables] section TopTeamName=(#League# + 1) and then in the relevant measure StringIndex=#LeagueName#, it fails and I just get nonsense as an output. What's going on? It doesn't make sense to me.
3) If I can't do that either, then I guess I just need to hardcode it (i.e. make one skin with eight sets of 22 measures and meters), then use enable, disable and the group bit to make it all work. I think I can do it, but (a) it's a bit brute-force, and (b) ...yknow, 350-odd measures/meters. I'm bound to make mistakes, and I'd never really be able to go back and edit the thing because of all the knock-on changes!
Hope this is all clear - code from current skin is below, in case that helps (I've commented out the lines where I'm trying to do (2), so you can see my syntax). Any help gratefully received!