Skip to Content

Exceptions in Fox foreach statement

Hello ,

Is it possible to prevent a Forloop to execute for a particular value?

For eg:

DATA PRODUCT TYPE ZPRODUCT.

FOREACH PRODUCT.

{KEYFIG,PRODUCT} = {KEYFIG,PRODUCT}*1.2

ENDFOR.

But i do not want this calculation to happen for a particular product. Lets say 0PRODUCT=X.

Is there any way like combining DO LOOP and IF Statement?

Thank you,

Arjun

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 17 at 07:56 AM

    FOREACH PRODUCT.

    If PRODUCT <> x.

    {KEYFIG,PRODUCT} = {KEYFIG,PRODUCT}*1.2.

    endif.

    ENDFOR.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16 at 09:05 AM

    hi,

    try with IF statement.

    Regards,

    Anand

    Add comment
    10|10000 characters needed characters exceeded