Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mhasel opened this issue Jan 16, 2025 · 0 comments
Open
Labels
bug Something isn't working high-priority

Comments

@mhasel
Copy link
Member

mhasel commented Jan 16, 2025

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.

@mhasel mhasel added bug Something isn't working high-priority labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

No branches or pull requests

1 participant