ReturnVar not initialized

For you to test, In the following code, when you push the commandbuttom, you get a message with some garbage at the begining, like if the ReturnVar is no initialized. Example message: x#9632;Ù±Test It seems to happen only when ReturnVar is Text(255) and there is no assignment (no match in CASE) Tested with Text(250), Text(254), Text(256), … it works ok. - OnPush() MESSAGE(TestFunction(‘A-4’, ‘Test’)); TestFunction(Parm1 : Code[10];Parm2 : Text[30]) ReturnVar : Text[255] CASE Parm1 OF ‘A-1’: ReturnVar := ‘Option A-1’; ‘A-2’: ReturnVar := ‘Option A-2’; ‘A-3’: ReturnVar := ‘Option A-3’; END; ReturnVar := ReturnVar + Parm2; Is this another bug?

Hi, -------------------------------------- TestFunction(Parm1 : Code[10];Parm2 : Text[30]) ReturnVar : Text[255] ReturnVar := ‘’; //Add this line of code CASE Parm1 OF ‘A-1’: ReturnVar := ‘Option A-1’; ‘A-2’: ReturnVar := ‘Option A-2’; ‘A-3’: ReturnVar := ‘Option A-3’; END; ReturnVar := ReturnVar + Parm2; ---------------------------------------- Small modification in your code will work fine(as mentioned with comment //Add this line of code).

Hi, I know this solution, and the others (Text(256), …). I just want to let you know what I think is another bug (the variable must be initialized by de system as a local var). Regards, Jesús Soage

Hi, I checked it and found the same what you have mentioned. Thanks for info. I don’t know the reason why it is printing garbage for only 255.