Skip to content

VAR_IN_OUT does not behave as expected when dealing with ARRAY OF STRING #1389

@mhasel

Description

@mhasel
FUNCTION foo
VAR_IN_OUT 
    in : ARRAY[0..1] OF STRING;
END_VAR
    in[0] := 'hello';
    in[1] := 'world';
END_FUNCTION

FUNCTION main
VAR bar : ARRAY[0..1] OF STRING; END_VAR
    foo(bar);
    printf('%s %s$n', REF(bar[0]), REF(bar[1]));
END_FUNCTION

When running the above example, the printed result is hworld, when it should be hello world.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions