Graphics

 View Only
  • 1.  If Than Scipting Help

    Posted 09-20-2017 19:52
    I'm green to scripting and trying to dive into it. We receive our quarter status as a single digit (ie. 2) and would like to have it displayed as 2nd QTR. I am trying my hand at a simple if then script to get this result. Below is the code i'm using on a text object that is hidden and receiving the value from the datalinq. STATUS OUTPUT is a text object displaying the status "1st QTR."


    Can someone help point me in the right direction? Also, I am not sure the difference between 'Scene' and 'Self when used to GetObject. Is the use of 'status' after the comma directing the "STATUS OUPUT" layer to the variable status?

    dim status as xpTextObject

    scene.GetObjectByName ("STATUS OUTPUT", status)

    If Text = "1" then
    status.Text = "1st QTR"

    end if


    Thanks in advance for the help with my confusion. If anyone knows of good literature or tutorials to help with scripting, i'd appreciate that as well.


  • 2.  RE: If Than Scipting Help

    Posted 09-21-2017 12:54
    It would honestly be a bit easier if you use Visual Logic for this (also assuming OT is sent as a single digit as well like 5 for OT1). To do this, you'll want to use the input selector box. I'd create a dummy text field that is datalinq to your scoring system, set that as the base to the input selector. If the value is 1, connect a string "1st QTR" to input 1 of the selector box (you might have to increment it by 1) and so on for the rest of your values. Have the output of the selector box run into your actual, visible text field that shows your quarters.
    #XPression


  • 3.  RE: If Than Scipting Help

    Posted 09-21-2017 17:12
    thank you! got it working.
    #XPression


  • 4.  RE: If Than Scipting Help

    Posted 11-01-2017 17:42
    Would it be possible to add a screenshot of your visual logic layout?
    #XPression


  • 5.  RE: If Than Scipting Help

    Posted 11-03-2017 16:52

    Here is how I do it. We needed to be able to do overtime as well. Mine just changes alpha values.


    #XPression