INTERACT FORUM

More => Old Versions => JRiver Media Center 28 for Windows => Topic started by: rbmjr on January 02, 2022, 07:26:19 pm

Title: Can't get Save() Load() global variables to work. Please Help
Post by: rbmjr on January 02, 2022, 07:26:19 pm
I want to run a Smartlist that captures into global variables the quantity of tunes from the 60's, 70's, 80's, 90's, 00's, 10's, and 20's that I want other Smartlists to use to limit the number of tracks via the "Limit Number to" modifier. I prepared one Smartlist with a "Custom" command to create a global variable called "var_np_1960" and assign it a value. Next I prepared a Smartlist to select songs from that decade limiting the number of tracks to "var_np_1960". Thought it would work, however, it is clear I am doing something wrong. Can someone please help?
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: EnglishTiger on January 03, 2022, 03:55:51 am
Take a look at this thread https://yabb.jriver.com/interact/index.php?topic=77826.0 (https://yabb.jriver.com/interact/index.php?topic=77826.0)
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: mark_h on January 03, 2022, 04:26:22 am
You want the [1]=1 logic in there to force evaluation and trigger the save

eg
Code: [Select]
[=save(1,v_albuminstrumental[albumunique])1]=1
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: mark_h on January 03, 2022, 04:27:46 am
Also, if an expression doesn't work directly you sometimes have to put it in a user field and use that instead, so your limit expression may not work as expected with the load() function.  If not stick the load() into a user defined field and then it will work.
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: mark_h on January 03, 2022, 04:28:56 am
When building such views it's always helpful to add an expression column to the view in which you display the contents of the variable so you can see whether the logic is working as expected.
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: zybex on January 03, 2022, 05:03:06 am
Another problem with setting your global variables in a Playlist is that globals are not persistent - when you restart MC, all of them are gone. So you would always need to open that Globals playlist at least once before your other playlists that use them can work.
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: rbmjr on January 03, 2022, 07:40:42 am
You all are awesome! Thanks so much for the quick replies, unfortunately my wife told me to stop farkeling with this and watch TV with her. This morning I tried your suggestions and I am halfway there; have the save() part working, stuck on the Load() part.

Attached are a couple of screen shots.

When I added the Load(var_np_1960) to the "Limit Number to" and click apply I get nothing. If I remove the modifier I see that the global variable displays the value set by the previous Smartlist. One of your comments suggested that "you sometimes have to put it in a user field and use that instead." Can you please elaborate? Where do I create a user field? and how to I add the Load() command to it?
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: zybex on January 03, 2022, 08:38:29 am
I think you can't use expressions on the playlist modifiers, at least on the Limit one it doesn't seem to work with any expression.
Perhaps you can request this as a new feature.
Title: Re: Can't get Save() Load() global variables to work. Please Help
Post by: rbmjr on January 03, 2022, 12:49:28 pm
Thanks for the feedback and everyone's help. Submitted a Feature Request to allow Global variables to be used in Smartlist modifiers. Locking this topic