Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have three text boxes, let's call them Object IDs A, B and C.
A=1, B=2, therefore I want C to equal the average, 2.5.
I know how to write a lengthy if statement but I can't work out how to write: =(A+B)/2
Any ideas?
Thanks in advance.
Hi
Use Sum function......
To do that you need to write a macro that reads the value of A and B, then does the calculation and puts that into C. And have that to be triggered on some event.
I guess it should look something like this:
set objA = ActiveDocument.GetSheetObject("A")
set objB = ActiveDocument.GetSheetObject("B")
set objC = ActiveDocument.GetSheetObject("C")
objC.SetText = objA.GetText + objB.GetText
Thanks for the above. Is tehre any way to do this without running a macro? I'd like the user to see it without having to press anything to calculate it.
Can you define 3 variables and show the variables in the text boxes. To declare the variables in the load script, use following:
LET var_A = 1;
LET var_B = 2;
SET var_C = '(var_A + var_B)/2';
notice the SET for var_C - this way, the value will be re-evaluated every time any of the variables is changing. You can also declare those variables in the runtime, using "Variables Overview" under "Settings".
good luck!
Oleg