Announcement

Collapse
No announcement yet.

Use of Byvar within byvar

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment


          • #6
            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...
            BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
            RRTube ==> [View/Download Youtube Videos]
            WifiMan ==> [Wifi Manager]
            RRec ==> [Audio Capture]

            If You Want To Be Given Everything, Give Everything Up ...
            Bird York -- In The Deep --

            Comment


            • #7
              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
              Last edited by lambosprit; 07-01-2011, 05:11 AM.

              Comment


              • #8
                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

                Comment


                • #9
                  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 Files
                  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

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      BTW, nothing was changed, it was ADDED in 2010...
                      -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

                      Comment


                      • #12
                        I was just going on what you posted above:

                        Originally posted by mitchjs View Post
                        a couple of things..

                        RRSDK.SetUserVar("YourVar", "YourValue")
                        and what is in the History.txt:

                        ex. SDK.SetUserVar("myvar","10")
                        Being it has always used the open and close parentheses, I did not think about that being the problem.

                        Even VB6's auto suggestion, showed to use the parentheses hahah!
                        Attached Files
                        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

                        Comment


                        • #13
                          yes.. you use them if you use the Keword CALL
                          its odd, but thats how the 20 year old vb6 IDE/compiler wants it...
                          -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

                          Comment


                          • #14
                            if you want somethng much much much much much better, switch to vb.net
                            -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

                            Comment

                            Working...
                            X