1 Reply Latest reply on Feb 9, 2017 5:45 AM by Rick Gerard

    Expression Problem: single & double Number

    Cameraman84 Level 1

      Good evening guys!

       

      Can someone tell me about this problem?

       

      Problem.jpg

      The logic is when I write the number automatically display first the Surname and after the Νame. When I check the Checkbox Control, display reverse fisrt the Name and then the Surname.

       

      When the numbers are double (10, 20, 30) all is ok!

       

      When the number is single (1,2,3,4), the algorithmn in the number 1 works ok.

      when I write 2, shows the number 1 with the name and surname reverse!!! 

      And from there on, the algorithm is one step back with the Surname and the Name reverse.

      I write 3, shows the 2 reverse

      I write 4 displays 3 reverse...

       

      Thanks you all

      John K.

       

       

       

      I have this expression:

       

      A = parseInt(text.sourceText);

      a1 = parseInt(comp("2.2 Team 2 Data").layer("No 1").text.sourceText);

      a2 = parseInt(comp("2.2 Team 2 Data").layer("No 2").text.sourceText);

      a3 = parseInt(comp("2.2 Team 2 Data").layer("No 3").text.sourceText);

      a4 = parseInt(comp("2.2 Team 2 Data").layer("No 4").text.sourceText);

       

       

      if(A==a1 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==0)) comp("2.2 Team 2 Data").layer("No 1").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 1 Surname").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 1 Name").text.sourceText;

       

       

      else if(A==a1 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==1)) comp("2.2 Team 2 Data").layer("No 1").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 1 Name").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 1 Surname").text.sourceText;

       

       

      else if(A==a2 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==0)) comp("2.2 Team 2 Data").layer("No 2").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 2 Surname").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 2 Name").text.sourceText;

       

       

      else if(A==a2 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==1)) comp("2.2 Team 2 Data").layer("No 2").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 2 Name").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 2 Surname").text.sourceText;

       

       

      else if(A==a3 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==0)) comp("2.2 Team 2 Data").layer("No 3").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 3 Surname").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 3 Name").text.sourceText;

       

       

      else if(A==a3 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==1)) comp("2.2 Team 2 Data").layer("No 3").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 3 Name").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 3 Surname").text.sourceText;

       

       

      else if(A==a4 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==0)) comp("2.2 Team 2 Data").layer("No 4").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 4 Surname").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 4 Name").text.sourceText;

       

       

      else if(A==a4 + (comp("1.2 Team 1 Data").layer("Name Controller").effect("Change Name <> Surname")("Checkbox")==1)) comp("2.2 Team 2 Data").layer("No 4").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 4 Name").text.sourceText + "  " + comp("2.2 Team 2 Data").layer("Player 4 Surname").text.sourceText;

       

      else text.sourceText