0

In/Decrement user variable -howto ?

Hi,

how can I (in BA) increment a (numeric) user variable with the value of another variable i.e  var1=var1+var2 ?

5 comments

  • 0
    Avatar
    Romeo

    Hi Zack,

    There is no way to do this type of operation in BA itself. You would need to use a plugin in order to achieve this.

    Please see below for further details on plugin:

    http://docs.brightsign.biz/display/DOC/BrightAuthor+Plugins+and+Parsers

    http://docs.brightsign.biz/display/BA44/4.4-Plugin+Message

    http://support.brightsign.biz/hc/en-us/community/posts/209965857-Plugins-Asked-Answered

     

    Regards,

    Romeo

  • 0
    Avatar
    Zack

    Hi,

    Thanks for the answer. As I´m not familiar with scripts and in a hurry - can anyone pls provide/show me how the source code (script itself) for this simple plugin would look like ?  I know how to use variables and attach plugins. Would be very grateful :)    

  • 0
    Avatar
    Lyndon

    I believe this was answered via support, but not sure. This example takes a plugin command updatevar!firstvariable!secondvariable.

     

    The plugin then adds the two together, and puts the value in firstvariable.

     

    https://www.brightsignnetwork.com/download/Scripts/updatevar.brs

     

     

  • 0
    Avatar
    Zack

    Yes, it was solved by support, Thank You!

    In the script above right parenthesis   ")"  are missing in line 109 and 110.  

     

     

     

  • 0
    Avatar
    JW

    For some reason this isn't working in my project (BrightAuthor 4.6.0.35)

    - I added the plugin via autorun
    - added two variables, even named them firstvariable and secondvariable (access: shared, type:local)
    - firstvariable has value 10
    - secondvariable has value 20
    - added a live text element with: uservariable 'firstvariable'
    - create a touchevent on the entire screen (remian on current state), and added (under advanced) a 'send' command -> send plugin message -> updatevar -> updatevar!firstvariable!secondvariable

    When I preview the presentation the text shows the value of firstvariable -> 10 nothing happens when I click the screen.

    Obviously I am doing something wrong, any advice?

Please sign in to leave a comment.