INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MIX and MATH  (Read 1168 times)

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
MIX and MATH
« on: August 30, 2012, 10:00:11 am »

Is it possible to use math() in a mix statement?

This is the my current attempt, but it's not working as expected:

~mix=21,[=math(4-abs(load(var_playingnowrating) - 10))],[my rating]=10,[=math(4-abs(load(var_playingnowrating) - 9))],[my rating]=9,[=math(4-abs(load(var_playingnowrating) - 8))],[my rating]=8,[=math(4-abs(load(var_playingnowrating) - 7))],[my rating]=7,[=math(4-abs(load(var_playingnowrating) - 6))],[my rating]=6,[=math(4-abs(load(var_playingnowrating) - 5))],[my rating]=5,[=math(4-abs(load(var_playingnowrating) - 4))],[my rating]=4,[=math(4-abs(load(var_playingnowrating) - 3))],[my rating]=3,[=math(4-abs(load(var_playingnowrating) - 2))],[my rating]=2,[=math(4-abs(load(var_playingnowrating) - 1))],[my rating]=1

Or to break it down, I'm using the following syntax:

~mix=21,[=math(expression)],rule1,...

Is it possible?  If so, what am I doing wrong?  ;D

Cheers,

Mark
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MIX and MATH
« Reply #1 on: August 30, 2012, 10:33:46 am »

The ~mix evaluator doesn't support expressions for the number part.

I suppose we could change this to push the value through a math evaluator, but the escapement (parenthesis, etc.) might get complicated.
Logged
Matt Ashland, JRiver Media Center

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: MIX and MATH
« Reply #2 on: August 30, 2012, 10:44:37 am »

Thanks, Matt.

Lack of math() doesn't break anything for me, but does reduce flexibility a little as I cannot get to my desired goal and so it would be nice to have.

However, I'll leave the decision to you :)

Thanks for the clarification.
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: MIX and MATH
« Reply #3 on: August 30, 2012, 11:19:23 am »

So I just tried to get around it using ~n (the idea being to use 10 sublists to generate the main result view) and I find that ~n also doesn't support math :D

I guess this is a general restriction in smartlists?

Which now means I think it would be another huge leap forward for all smartlist expressions to support math.  It would, once again, open up another world of possibility within MC :D

Please add to MC18 ASAP ;)
Logged
Pages: [1]   Go Up