cancel
Showing results for 
Search instead for 
Did you mean: 

DP Macro- IF loops

Former Member
0 Kudos

Hi all,

I am bit bogged down by IF loop.If there are two loops in a step, for example,

IF

Condition1

-


Expression1

Then------

IF

Condition2

-


Expression2

Then-------

ENDIF

ENDIF

which loop will be executed first?

Inputs are welcome

Vard

Accepted Solutions (0)

Answers (1)

Answers (1)

srinivas_krishnamoorthy
Active Contributor
0 Kudos

the logic is similar to any general programming logic. The outer layer is executed first and if the control passes through the outer layer, it goes into the inner layer. If you are observing something unexpected, may be you can share the details.

Former Member
0 Kudos

Hi,

Thanks for the reply. My requirement is to check

IF KF1 is not fixed then enter the next IF loop, else(IF FIXED) exit the entire step.

In the next loop IF KF1=0 then write KF2 to KF1 else exit.

My macro will look like,

step1:

If

not fixed

then KF1=0

In step2 I am facing the above problem. I have to check first if KF1 is fixed, if not KF1=KF2 for all KF1 which has a value of zero(done in step1)

Inputs are welcome

Thanks

srinivas_krishnamoorthy
Active Contributor
0 Kudos

I would recommend you to use

if...then...else...then ...endif endif loop

I dont think your requirement even warrants a second "if" loop.

So it can be

If

not fixed

then KF1=0

else KF1=KF2

end if

Former Member
0 Kudos

Thanks for the reply. Somehow I am not able to write KF1=KF2, unless I zero KF1. My macro now looks,

step1

if not fixed

then KF1=0

end

step2

if KF1=0

then KF1=KF2

end

this works very well except I fix KF1 at zero, where step2 overwrites. So I need to check KF1 fixed for a second time in step2 aswell as look for zero values for KF1.

I can send the macro if I have your permission.

Thanks