Forum Discussion

megha_gambhire's avatar
megha_gambhire
Contributor
13 years ago

How to compare Table values.

My Scenario is that I am entering a some values in Text box as


Call Aliases.QBIS.ExpressionEditor.expPanel.ExpressionEditorForm.expressionEdit.TextBoxMaskBox.Keys("3.5")


Actually I am multiplying this ( 3.5) with some cloumn values. Like I have Rate column which contain following values.


Rate


2

3

4

6


In My application I am Multiplying this Rate column with fixed integer 3.5, by which my application creates New Calculated column

as


New Calculated column

7

10.5

14

17.5


Now I am dropping both column into a single Grid and Inserted a table check point on it.


And want to verify if New alculated values are as per the calculation


i.e.


7=2*3.5

10.5= 3*3.5 and so on.


For this how to store a value entered in

Text box(Aliases.QBIS.ExpressionEditor.expPanel.ExpressionEditorForm.expressionEdit.TextBoxMaskBox.Keys("3.5")) into a variable.

2 Replies

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Hi Megha,


    Perhaps, you can use the following code:




    MyNumber = 3.5 ' Variable that will store the value

    Call Aliases.QBIS.ExpressionEditor.expPanel.ExpressionEditorForm.expressionEdit.TextBoxMaskBox.Keys( CStr(MyNumber) )


    Then, you can use  MyNumber * 2, MyNumber * 3, etc. in comparison statements.


    An alternative approach is to set the value and then read the text box contents to a variable:




    Aliases.QBIS.ExpressionEditor.expPanel.ExpressionEditorForm.expressionEdit.TextBoxMaskBox.Keys("3.5")

    MyNumber = CInt(Aliases.QBIS.ExpressionEditor.expPanel.ExpressionEditorForm.expressionEdit.TextBoxMaskBox.Text)


    If you use keyword tests, you can perform the same actions with the Set Variable Value operation.