No announcement yet.

How do I set a variable from a plugin so it can be used in the next command

  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I set a variable from a plugin so it can be used in the next command

    I have a plug-in in development that one of it's commands, let's say "MYPLUGIN_CMD", needs to set an RR variable.

    I do this with SDK.EXECUTE("SETVAR;MYPLUGINVAR1;prog.exe") and observe that the SETVAR is executed right after my plug-in command finishes executing as expected.

    However, if I have the following coded on a button:

    B01,.....,"MYPLUGIN_CMD;data1||RUN;$MYPLUGINVAR1$" ,"DOIT"

    I see that the SETVAR is executed AFTER the RUN command which, of course, sees no/or incorrect data in MYPLUGINVAR1 because it hasn't been created/updated yet.

    First, is there anyway to set the variable at the time the plug-in command executes to satisfy the requirements outlined above?

    Second, anyone have any ideas how to accomplish this?

    Third, in the general case shouldn't RR commands from the plug-in be logically queued by RR right after the currently executing command as they are logically output of that command. Actually the case could be made that there is an inconsistent behavior in the SDK in that SDK.GetInfo is executed immediately whereas SDK.EXECUTE is processed after all other queued commands not necessarily after the command that created it.


  • #2
    The IDEAL solution would be to only execute "MYPLUGIN_CMD" and have your plugin execute BOTH: "SETVAR;MYPLUGINVAR1;prog.exe||RUN;$MYPLUGINVA R1$" -- in the case of RUN, your plugin could just launch the application already. If you want "MYPLUGIN_CMD" to have the option between setting the var and then run OR just set the var, then you can make a parameter for it.

    Another alternative (less Ideal) would be to use a delay:
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."