Results 1 to 5 of 5

Thread: Increment numerical valued variables

  1. #1
    Constant Bitrate Tensai's Avatar
    Join Date
    Jun 2006
    Location
    Texas
    Posts
    137

    Increment numerical valued variables

    I want to use variables to make slight changes to a command during run time. I.e. I want run the following command

    "LOADLIST;c:\playlists\$number$.m3u;Playlist $number$"

    However, I want the value of $number$ to increment each time the command is executed. I tried plugging in mathematical expression...

    "LOADLIST;c:\playlists\$number$.m3u;Playlist $number$||SETVAR;number;$number$+1"

    But that was a no go. I also tried $number$++ to no avail.

    Any suggestions would be much appreciated.

    Also, if it makes a difference this command will be stored in ExecTBL.ini. Not in a skin file directly.

  2. #2
    Constant Bitrate Tensai's Avatar
    Join Date
    Jun 2006
    Location
    Texas
    Posts
    137

    Nevermind

    EVAL

    I had an old copy of Skin Commands.txt.


  3. #3
    SMKFree liquid_smoke's Avatar
    Join Date
    Aug 2003
    Location
    Chicago
    Posts
    4,842
    i have a piece of code thats setup to do this.
    In mine i have 2 commands, one that counts up and one that counts down.

    Just curious if you've found a way to not have negative numbers?
    01101100 01101001 01110001 01110101 01101001 01100100 01011111 01110011
    01101101 01101111 01101011 01100101

    beer replenishment fund
    http://www.mp3car.com/vbulletin/rr-faq/
    mp3car live search

    i have joost invites, just hit me up for one.

  4. #4
    Constant Bitrate Tensai's Avatar
    Join Date
    Jun 2006
    Location
    Texas
    Posts
    137

    upper / lower bounds

    I have. I set mine up to have a min/max number of playlists. Right now its set to six because thats the number of playlist buttons I have on the skin I'm working on. But it could be any number you wanted it to be. Here is my code from ExecTBL.ini...

    Code:
    /, Custom Increment/Decrement Commands for Playlists
    "INCPLAYLIST","EVAL;playlistnum;$playlistnum$+1||LOADLIST;c:\playlists\$playlistnum$.m3u||SAVETOSKIN;playlistnum;$playlistnum$"
    "DECPLAYLIST","EVAL;playlistnum;$playlistnum$-1||LOADLIST;c:\playlists\$playlistnum$.m3u||SAVETOSKIN;playlistnum;$playlistnum$"
    
    /, Car2PC Commands
    "ND ","EVAL;maxbound;strcomp("$playlistnum$";"6")||BYVAR;maxbound;INCPLAYLIST<<"
    "PD ","EVAL;minbound;strcomp("$playlistnum$";"1")||BYVAR;minbound;DECPLAYLIST<<"
    Since VB doesn't really distinguish between chars/strings/integers you can do a string compare against your upper/lower bounds. The EVAL strcomp returns a 1 if your at your min/max. Using BYVAR I then increment/decrement if EVAL statement returns a 0 (you're not at either bound). If it returned a 1 then I do nothing. The current playlist number is saved to skin.ini so that it doesn't reset everytime you reload RR.

    I've tested this and it works great. You can change the number of possible playlists by modifying the "6", and "1" in the two Car2PC command lines. This is probably clear as mud, but it really does work well. Knowing you though, you've probably got a cleaner solution already.

  5. #5
    SMKFree liquid_smoke's Avatar
    Join Date
    Aug 2003
    Location
    Chicago
    Posts
    4,842
    cool thanks, thats what i was missing, min/max values. I just need another eval and or byvar that looks at the current number and if it matches the min do nothing.
    You code looks fine to me, pretty much the same way i did it, minus the min/max.
    01101100 01101001 01110001 01110101 01101001 01100100 01011111 01110011
    01101101 01101111 01101011 01100101

    beer replenishment fund
    http://www.mp3car.com/vbulletin/forumdisplay.php?f=93
    mp3car live search

    i have joost invites, just hit me up for one.

Similar Threads

  1. Dividing variables
    By frangolfgt in forum Road Runner
    Replies: 7
    Last Post: 07-19-2007, 07:30 PM
  2. Replies: 10
    Last Post: 02-06-2007, 04:46 PM
  3. Some clarity on variables being sent to flash objects...
    By Sonicxtacy02 in forum Road Runner
    Replies: 7
    Last Post: 10-17-2006, 12:44 PM
  4. How do I use Variables on my Skin ?
    By guino in forum RR FAQ
    Replies: 0
    Last Post: 06-07-2006, 10:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •