‎2008 May 20 10:15 AM
Hi,
I found this line of code in one of the program that i'm modifying.
IF 0 = 1.
bla bla.
ENDIF.
Anyone can explain to me what the above syntax does? Or mean?
Thanks in advance.
‎2008 May 20 10:29 AM
Dear ~loObie,
Sometimes programmer write some logic in program but later they come to know that might be in future this should not execute but that time they thought might be in future again it should be execute.
in such case we put such condition like 0 = 1 which is never executes.
so in future we doesn't make huge change only instead of omitting such condition(0 = 1).
Hope now this should clear to you.
please close thread after giving points.
Amit.
‎2008 May 20 10:18 AM
I think you found
IF o = 1.
bla bla.
ENDIF.
not ..............
IF 0 = 1.
bla bla.
ENDIF.
Regards,
Madan.
‎2008 May 20 10:20 AM
Hi ~loObie
This means the Condtion in IF will not satisfy ever and it wont
enter into the IF condtion ,it direcltly skips to else.
Please reward points if found ok.
Thanks and regards,
Rajeshwar.
‎2008 May 20 10:23 AM
Hi,
If 0 = 1
means zero will be never equal to 1.
the condition always fails and the code inbetween never gets
executed.
the intention is not to execute that particular code written in between the condition.
Regards,
Raj.
‎2008 May 20 10:25 AM
Hi ~loObie
,
IF 0 = 1.
......
.....
ELSE.
.......
......
ENDIF.
Here this statement has been included, so that this code should not be removed, it may be used/not used.
It is just like commenting, instead of commenting or removing the code , they have used this particular statement.
‎2008 May 20 10:26 AM
Hi,
the "then-part" of that if-clause seems to be dead code.
I don't know the context.
Check out the point of origin but don't spend too much time..
Has this part of code arisen from customer or from sap.
I suppose from customer.
regards
Walter Habich
‎2008 May 20 10:29 AM
Dear ~loObie,
Sometimes programmer write some logic in program but later they come to know that might be in future this should not execute but that time they thought might be in future again it should be execute.
in such case we put such condition like 0 = 1 which is never executes.
so in future we doesn't make huge change only instead of omitting such condition(0 = 1).
Hope now this should clear to you.
please close thread after giving points.
Amit.
‎2008 May 21 2:25 AM
Thanks to all your feedback. I think Jony's is right. Commenting out the particular code without any much modification.
‎2008 May 21 2:38 AM
some times these sort of condition will be used like a navigation points of programmers... they will use same if 0 = 1 in some other place in some other part of code... with a simple find for this condition in any include will be catched and can be related...
these sort of conditions are just for programmers convenience.
‎2008 May 21 6:22 AM