Forum Discussion

Oesmerilhador's avatar
Oesmerilhador
Occasional Contributor
9 years ago

how to compare values ​​labels?

Hi, please!

 

how to compare values labes?

 

example: 300,37 + 8,83 = 309,20 ---> I want TestComplet "software" check this !

 

 

tks

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Quick and easy, you basically use the programming language to do the sum for you and then compare the sum from the script to the sum on screen.  Here's a quick and dirty function I wrote in JScript

     

    function TestValues(Value1, Value2, Total)
    {
        var TestTotal = aqConvert.VarToFloat(Value1) + aqConvert.VarToFloat(Value2);
        if (TestTotal == Total)
        {
            Log.Message('The Total on screen is correct');
        }
        else 
        {
            Log.Warning('The Total on screen is incorrect');    
        }
    }