I have a generic function/procedure with 2 text-parameters, of which one is a VAR.
Purpose is to pass value from one parameter to the other one.
To avoid an overflow this is done with COPYSTR and MAXSTRLEN.
*I have a Text1, and I have a Text2
*I want to assign Text1 := Text2
One way is to write “Text1 := COPYSTR(Text2, 1, MAXSTRLEN(Text1));”
The other way is to do it via a function/procedure:
PROCEDURE myProc(VAR pv_tx1@1161000000 : Text;p_tx2@1161000001 : Text);
And the calling “myProc(Text1, Text2);”
Even if the first parameter is defined as Text, I extpect that it will inherit the length (50) from the calling VAR-parameter.
And by that get the first 50 characters from Text2 returned in Text1.
That is what is happening in C/AL.
But I do not get the same result in AL.
Here it keeps that Text.
And I only get the first character returned.
Is this an error?
Is it changed on purpose?
Or - am I missing that an update that already has taken care of this?
I have tried this in BC14, in C/SIDE and in AL.