Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make variable that is re-defined per section and readable in same-section formula? 2

Status
Not open for further replies.

AleXSR700

Technical User
Jul 20, 2023
17
DE
Good morning,

unfortunately my initial approach for using a formula to identify the section the formula is iused in, was not possible with built-in methods (
I now have a new approach but I seem to be getting one detail wrong.

Idea is to have a global stringvar as identifier in each section that changes value with section change. And then use this stringvar in a formula within that section.
Code:
//formula a
global stringvar section:="a"

//formula b
stringvar section:="b"

//formula test
stringvar section;
local numbervar test;

If section="a" Then
    test:=1
Else If section="b" Then
    test:=2;
test
However, the stringvar section is being shown correctly in each section but the result of test is always the same (that for the second section.

2190458-image_lgq8tt.png


2190457-image_jogmxn.png


Does anybody see what I am doing wrong?

Thank you

Alex
 
Thank you both for your support. I appreciate you trying to help me.

I did not describe anything elae because there is nothing else to describe and I don't know what else to tell you.

I have tried all kinds of approach ideas.

There is effectively one input value, a simple mathematical calculation and then the output value. The only condition for changing the input value is the section. There is nothing else. no parameter, no nothing.

So, I will live with the extra code but apreciate you trying to help. :)

Have a great weekend :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top