Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Use of Byvar within byvar

  1. #1
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    786

    Use of Byvar within byvar

    I want to do the following

    I have a variable that I set to determine which set of commands to use.
    Set one controls one part of my plugin set two controls the other.
    I have a byvar that toggles through play , pause, stop etc but i want to do this depending on my first variable as well.

    This is my example
    BYVAR;RRSCRN;
    (BYVAR;CUSTOMVLC1STATUS;SETVAR;VLC1ACTION;PAUSE<<S ETVAR;VLC1ACTION;PLAY<<SETVAR;VLC1ACTION;NORMALSPE ED<<SETVAR;VLC1ACTION;PLAY)
    <<(BYVAR;CUSTOMVLC2STATUS;SETVAR;VLC2ACTION;PAUSE< <SETVAR;VLC2ACTION;PLAY<<SETVAR;VLC2ACTION;NORMALS PEED<<SETVAR;VLC2ACTION;PLAY)"

    Needless to say it didn't work. Tried to change the BYVAR to the new BYVARX but that didn't work. Dont really want to put it in the exectbl.ini either if I can help it.

    Anyone out there with any ideas on how I can do this?

    Also is there anyway to set a default value to a var? I have BYVAR;RRSCRN;SETVAR;RRSCRN;1<<SETVAR;RRSCRN;0 but until the button is pushed RRSCRN is blank. I would like it to start at 0 without the button being pushed.

  2. #2
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,700
    Blog Entries
    1
    Not sure on the ByVar stuff.....

    But as far as setting a variable:

    There are a couple of ways, in your plugin, in the Initialize section of the code that runs only once, you can set it there:

    Code:
    tmp = RRSDK.GetInfo ("=MyVar$)"
    If tmp = "" then
      RRSDK.Execute("SetVar;YourVar;DateInVar")
      RRSDK.Execute("SaveToIni;YourVar;DateInVar") '  <--- saves for later recall on next load if you want it to be remembered  
    End If
    The other options are in the OnSkinStart line of the exectbl, or saving it to the skin or RR.ini's and it will be set when RR loads.
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  3. #3
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    786
    Quote Originally Posted by JohnWPB View Post
    in your plugin,
    Thanks John. Thats what I'm currently doing but it feels messy.

    The other options are in the OnSkinStart line of the exectbl
    This looks interesting. I'll take a look.

    P.s. did you ever get the mileage plugin working

  4. #4
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,255
    a couple of things..

    USE BYVARX, 1st off byvar dont support ( )
    (i didnt really look at that confusing bit of code, just noticed byvar)

    STOP using SETVAR in plugins!!!!!!!

    RRSDK.SetUserVar("YourVar", "YourValue")

    and think if your doing a plugin, do i really need this var as a USERVAR?

    STOP using GETINFO for vars!
    value = RRSDK.GetUserVar("YourVar")
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

  5. #5
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,255
    also, if your plugin has settings, in gernal, they should NOT be stored in RR.ini or skin.ini
    i would consider if .net Settings class, if old vb6 do an ini file... or xml
    there are simple .ini reading and writing using winapi code out there...
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

  6. #6
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,283
    Quote Originally Posted by mitchjs View Post
    STOP using SETVAR in plugins!!!!!!!

    RRSDK.SetUserVar("YourVar", "YourValue")

    and think if your doing a plugin, do i really need this var as a USERVAR?

    STOP using GETINFO for vars!
    value = RRSDK.GetUserVar("YourVar")

    also, if your plugin has settings, in gernal, they should NOT be stored in RR.ini or skin.ini
    i would consider if .net Settings class, if old vb6 do an ini file... or xml
    there are simple .ini reading and writing using winapi code out there...

  7. #7
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    786
    Quote Originally Posted by mitchjs View Post
    a couple of things..

    USE BYVARX, 1st off byvar dont support ( )
    (i didnt really look at that confusing bit of code, just noticed byvar)

    STOP using SETVAR in plugins!!!!!!!

    RRSDK.SetUserVar("YourVar", "YourValue")

    and think if your doing a plugin, do i really need this var as a USERVAR?

    STOP using GETINFO for vars!
    value = RRSDK.GetUserVar("YourVar")

    Yah. Thanks for the flaming. Its this kind of reply that scares people off doing anything with RR!

    Didn't notice any notes saying that setvar or getinfo shouldn't be used in plugins, guess its hidden somewhere though. How about making these kind of changes to approach more open so people can see rather than flaming because they dont know. We had a nice thread about plugin standards which I spent a long time trying to follow. Haven't notice an update to that for these new "requirements".

    I also know that () isn't supported by BYVAR but thought they would allow my "confusing" code to be read. Its pretty simple really if you looked at it. Just two byvars controlled by a third one.

    Also I'm not using it in a plugin. I'm using it in a skin for a plugin.

    I think you've all got the wrong end of the stick.

    Let me explain a bit more. My RRVLC plugin allows two seperate vlc's to be run at the same time. Everything I've done on my skin works for one set of commands that control screen 1 of vlc. Same for screen 2. But rather than having two skin files I wanted to use one skin with a variable to control which instance (screen) of vlc I am wanting to control.

    For the control of whether to send a play, pause or normal play (return to normal play speed from slow or fast play) I have a nice byvar command that works fine.

    However when I apply a second byvar to control which screen i want to send the relevent command to it fails because it sees the first << as part of the first byvar not the second.

    So my logic (not in my plugin but in my thinking for how the skin should work) is

    If screen 1 currently selected
    ____if screen 1 currently playing send pause to screen 1
    ____else if screen 1 currently paused send play to screen 1
    else if screen 2 currently selected
    ____if screen 2 currently playing send pause to screen 2
    ____else if screen 2 currently paused send play to screen 2

    I hope this makes things clearer and results in helpful comments rather than more flaming

  8. #8
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,255
    the stop, isnt just directed at you, its directed at anyone writing plugins... you have to think how the "EXEC" command works...
    and why you shouldnt you ANY setvars in a plugin, now getuservar is just a convience and makes for better looking code
    i dont know what you're trying to do... but if u want byvar in a byvar... i suggest the item that is to be the second byvar... be a command, that is
    translated into your byvar in exectbl...
    my philosphy is to avoid exectbl.... but in a old byvar you cant in your case...
    still sounds like you have a plugin "My RRVLC plugin" and shouldnt have any of this code in skin code!!!
    should be done in the plugin!


    on i side note, no flaming here, just some policing of plugins...
    others see the posted code, and could use it
    one thing for sure, a bad plugin, could lead to a bad rr experience...and have people
    say rr is bad, or rr isnt doint this or that anymore...
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

  9. #9
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,700
    Blog Entries
    1
    I just tried the "New way to do things", and it is considered a syntax error in VB6, using the latest VB6 examples included with RR.

    Looking back in the history.txt, I found where it was changed in there back in 2010.

    ex. SDK.SetUserVar("myvar","10") vs SDK.Exec("setvar;myvar;10")

    I tried a few variations:

    RR.SetUserVar ("TestVar","WTF")
    RR.SetUserVar ("TestVar;WTF")
    RR.SetUserVar ("TestVar,WTF")
    Attached Images Attached Images  
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  10. #10
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,255
    that is a vb6 syntax error!!!

    assuming RR is the sdk object

    its

    RR.SetUserVar "TestVar", "WTF"

    or

    Call RR.SetUserVar("TestVar", "WTF")
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

Page 1 of 2 12 LastLast

Similar Threads

  1. BYVAR nesting?
    By shaken94 in forum Road Runner
    Replies: 3
    Last Post: 05-05-2011, 08:14 AM
  2. Byvar and LoadIMG problem
    By toxic000 in forum Road Runner
    Replies: 14
    Last Post: 03-08-2009, 03:49 AM
  3. using BYVAR in Indicator
    By turchino in forum Road Runner
    Replies: 4
    Last Post: 11-22-2006, 10:01 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
  •