Graphics

 View Only
  • 1.  Changing a single letter to full word in Visual Logic via DataLinq

    Posted 10-07-2020 16:04

    Working on some sports DataLinq and trying to figure out how change a letter to a full word in Visual Logic

    Example:

    D to DEFENSEMEN

    The data says "D" & I want it to auto populate to say "DEFENSEMEN"

    Thanks!

     



  • 2.  RE: Changing a single letter to full word in Visual Logic via DataLinq

    Posted 10-07-2020 18:09

    So I figured out how to do the replacement but if I wanted to do 

    F to FORWARD

    It changes the DEFENSEMEN to DEFORWARDENSEMEN

    Is there a way to change that?


    #XPression


  • 3.  RE: Changing a single letter to full word in Visual Logic via DataLinq

    Posted 10-08-2020 16:15

    Hey Tristan,

    As always, there are multiple way to do this, but give this a shot.


    #XPression


  • 4.  RE: Changing a single letter to full word in Visual Logic via DataLinq

    Posted 10-08-2020 17:56

    Steve,

    Unfortunately that did not work. I was getting a "0" when I tried to input the Data into Xpressions.

    I was able to figure it out with the REPLACE module. But the way I did it is ass-backwards, it worked for me.

    So example:

    F to FORWARD

    It changes the DEFENSEMEN to DEFORWARDENSEMEN

    But I was able to tell it if it sees "DEFORWARDENSEMEN" Replace it with DEFENSEMEN.

    Yes its not the most IDLE way to accomplish this, and I had to do the same for multiple names, but in the end, I got the result I needed. 

    Thank you for taking time to come up with your method though.


    #XPression


  • 5.  RE: Changing a single letter to full word in Visual Logic via DataLinq

    Posted 10-08-2020 19:45

    Cool! Glad you got it to work. Many options. For anyone who comes across this in the future:

    Tested that above example again, and the only way that you can get a 0 value at the second text input is if the Output of your first Input Selector is plugged into the Index of your Second Input Selector. Your First Input Selector Output should go into the "0" of the second input Selector. That first Input Selector can only output blank or Defenseman based on the argument "0" = nothing and "1" = defenseman. I would double check where you pointed the different outputs.

    Another way to accomplish this is using one Input Selector block and using Math blocks to increase the boolean value to the appropriate numbers. You could also skip that "blank" String Value block going into "0" and increment the Input Selector to start at "1"

    Finally, you could do this with just a single Text Block and Scipting.

    Copy the following script into the OnSetText of the text object that is being Datalinq'd and receiving the D, F or G values:

    Text = text.replace("old text", "newtext")

    if text = "D" then

    text = "Defenseman"

    elseif text = "F" then

    text = "Forward"

    elseif text = "G" then

    text = "Goaltender"

    end if

    You'll see the reaction when you drag it over to the Sequencer and either manually type in the values or the Datalinq value changes.


    #XPression