Start chui under 11.7 version.
Run code below:
def var a as longchar no-undo.
def var b as longchar no-undo.
def var c as longchar no-undo.
a = "a1".
b = "b2".
c = "c3".
function test longchar(a as longchar):
def var dd as longchar.
dd = a.
return dd.
end.
a = a + c + test(b).
MESSAGE STRING(a).
Result is
c3b2
Expecting result:
a1c3b2
Under gui version all works correctly!
Under linux chui may get core dump while compiling.
I tried this using the 11.7.4 CHUI client ("Character Procedure Editor") on Win 10 64-bit, and got "a1c3b2". Same with the "GUI Procedure Editor".
11.6.3 AIX chui: a1c3b2
Hello,
I just tested with 11.7 (build date Mar 17th) on Linux CentOS, 11.7.4 (build date Oct 10th) on Linux Ubuntu and 11.7 ChUI (build date Mar 27th) on Windows.
I am able to see the expected result in the 3 environments.
Could you test using 11.7.4?
I hope this helps.
Linux 64-bit 11.7.3: c3b2
Win 64-bit 11.7.4: c3b2
Win 32-bit 11.7.4: a1c3b2
I'm assuming you are deliberately creating a scenario where the parameter "a" is replacing another variable with the same name (that is already scoped to the outer procedure)?
If the parameter to the function ("a") is renamed to "x" then would the problem go away?
It seems like you are asking for trouble if you use overloaded meanings of a variable name, as you do in this example.
You've probably spent some time at this. What happens if the datatype of "a", in the function, is switched to an integer. Is the compiler less confused when there are totally different datatypes involved? Is the problem specific to longchar or does it happen with character variables? What about if you have a FORWARD declaration of the function that is declared *before* defining the variable in the outer procedure ("def var a as longchar no-undo.").
I don't think it's asking for trouble if you use "a" within the function as well as the outer scope. That should just work.
FWIW: 11.7.4 Win x64 (CHUI): gives me the expected a1c3b2 (tried it with UTF-8 & iso8859-1 cpinternal)