Skip to Content
0
Former Member
Oct 26, 2005 at 05:15 PM

Unexpected FOX behaviour

20 Views

I run the following FOX function:

DATA USD TYPE F.

DATA TEST1 TYPE F.

DATA TEST2 TYPE F.

BREAK-POINT.

TEST1 = {DIPVERDI,INNT_OLJE,N}.

{DIPVERDI,OLJEPRIS_NOK,N} = {DIPVERDI,INNT_OLJE,N}.

BREAK-POINT.

USD = {DIPVERDI,FORUTS_NOK_USD_RATE,E}.

TEST1 = {DIPVERDI,INNT_OLJE,N}.

TEST2 = TEST1/USD.

{DIPVERDI,FORUTS_OLJEPRIS,N} = TEST2.

The first operand is key figure name. In my database I have one record matching {INNT_OLJE,N}. And in that record, DIPVERDI has the value 150. There is also a record matching {FORUTS_NOK_USD_RATE,E}, with DIPVERDI having the value 6,2846.

When executing the function, I observe the complete code is run twice. Can anyone explain why?

Even more strange: The first time it runs, TEST1 will get the value 0, while USD will get the value 6,2846. The second time, TEST1 will get the value 150 and USD will get the value 0. I would expect the code to be run only once and with TEST1 getting the value 150 and USD getting the value 6,2846. Can anyone explain what may be happening here?