I have noticed a very odd behaviour with an IF-statement in Progress 4gl.
I define an integer with the format "999" which tells it to have 3 digits and then I assign a value lower than 100 (eg. 12) then when I display it it shows as "012" as it should.
But when I add an IF-statement inside the DISPLAY statement that really shouldn't do anything, the variable is displayed as "12".
This is a test code to clearify the differences. The LABEL doesn't affect the output of the variable.
DEF VAR tmp AS INTEGER FORMAT "999".
ASSIGN tmp = 12.
DISPLAY
tmp LABEL "disp1".
DISPLAY
IF TRUE THEN tmp ELSE tmp LABEL "disp2".
The same behaviour could also be acheived by changing the format to ">99".
My question is: Why does an IF-statement change the way a variable is displayed?
Best regards //MrBucket