More > JRiver Media Center 20 for Windows
Examples of the new LOAD and SAVE functions?
glynor:
--- Quote from: Matt on April 25, 2012, 04:44:50 pm ---Next build:
Changed: Expression variables used with Load(...) and Save(...) are global, and valid for the run of the program.
However, I reserve the right to back-track on the first sign of trouble.
--- End quote ---
Yeah.... This made me nervous when I read it tonight.
It could certainly come in handy, and there really needs to be a way to pass variables from expression to expression easily (as in the examples given, which were certainly my first thoughts for using this). I guess more for the second reason you gave than the first, but... Really more that...
Even with my limited programming experience I understand many of the reasons why it is a good rule-of-thumb to scope your variables (and whatnot) as narrowly as is practical. And when not needed, with complicated expressions, I can also see it leading to trouble and difficult debugging. So it concerns me on a basic level that these are all global.
It seems like asking for trouble. But then, I'm having some trouble thinking of use cases for them in any case. I know I've wished for them (not even that long ago, during my iDevice syncing adventure), but I'm fried I guess.
Wouldn't it be possible to have local variables that you can store in a custom Field when you need them to be global?
I don't know... Feel free to ignore me.
mark_h:
OK, so this is now sort of working...
I create a seed smartlist that pulls ONE entry from my database and has an expression column that save()'s a variable based on a piece of data. WORKS.
I create a second smartlist that calls the seed smartlist, but I don't get refreshed values for the variable... just whatever was created when the seed smartlist was manually called...
This defeats my goal, which is to use the seed smartlist to AUTOMATICALLY refresh the variable every time it is used.
Can this be achieved?
mark_h:
So as an example, here is what I've achieved (ignoring the auto-refresh issue...)
VarChartEntry is the variable, generated by the seed smartlist and is a random week in pop charts history.
RegexpPosit... is a regular expression, using VarChartEntry, to find the chart position of all tracks I have that were in the charts that week as shown by the data in Chart History (singles).
Finally I sort on RegexpPosit to give the order for the charts in the VarChartEntry week.
The idea is that I can generate (at random if auto-refresh were available) a week of chart tracks sorted by their chart position.
rick.ca:
--- Quote from: mark_h on April 26, 2012, 06:11:57 am ---So as an example, here is what I've achieved (ignoring the auto-refresh issue...)
--- End quote ---
Could you avoid the auto-refresh issue by determining the random week mathematically in the same smartlist, rather using the separate seed smartlist?
mark_h:
--- Quote from: rick.ca on April 26, 2012, 06:23:49 am ---Could you avoid the auto-refresh issue by determining the random week mathematically in the same smartlist, rather using the separate seed smartlist?
--- End quote ---
Without variables, AFAIK, it's impossible to do because there is no concept of data perpetuating across records; same reason we cannot calculate album ratings etc. Certainly I've tried, but always failed, hence my strong desire for variables and now for AUTO-REFRESHING when a smartlist is referenced within another (the data refreshes, so not sure why the variables don't - will leave that for Matt...)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version