Skip to Content
0
Former Member
May 12, 2014 at 06:52 PM

(re)Set multiple variables in an IF statements

329 Views

Hi,

I suppose I've always avoided this, but I'm stuck at this point...

I have a formula with multiple variables that I'm reseting. My approach right now is:

whileprintingrecords;

global numbervar PrevInv;

global numbervar PrevLine;

global numbervar PrevBOM;

global numbervar CommTypeLine;

global numbervar CommTypeInv;

if PrevInv <> {Commission.AROBP_A_IDINVC} then

PrevInv := {Commission.AROBP_A_IDINVC}

PrevLine := {Commission.POS_POS_NR}

PrevBOM := {Commission.STKL_BOM_ID}

else

if PrevLine <> {Commission.POS_POS_NR} then

PrevLine := {Commission.POS_POS_NR}

PrevBOM := {Commission.STKL_BOM_ID}

else

if PrevBOM <> {Commission.STKL_BOM_ID} then

PrevBOM := {Commission.STKL_BOM_ID}

;

Of course, at line 10, it says that "the remaining text does not appear to be part of the formula".

Is this just a syntax issue, or is it a limitation? Workaround?

I have other logic that I need to add.

Matt