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

Manual Content: Values And References page has two instances of missing "_orig" in its code sample #9226

Closed
juner opened this issue Jan 31, 2025 · 1 comment
Assignees
Labels
docs-bug GameMaker Manual Bugs
Milestone

Comments

@juner
Copy link

juner commented Jan 31, 2025

Description

Pass by Value and Pass by Reference's code

function try_to_modify_value(_value, _new_value)
{
    _value = _new_value;
}

function try_to_modify_array(_array, _new_value)
{
    array_push(_array, _new_value);
}

var _val_orig = 48593;
try_to_modify_value(_val, 75);
show_debug_message(_val_orig);

var _array_orig = [1, 2, 3];
try_to_modify_array(_array, 100);
show_debug_message(_array_orig);

Could that possibly be what the next code means?

function try_to_modify_value(_value, _new_value)
{
    _value = _new_value;
}

function try_to_modify_array(_array, _new_value)
{
    array_push(_array, _new_value);
}

var _val_orig = 48593;
try_to_modify_value(_val_orig , 75);
show_debug_message(_val_orig);

var _array_orig = [1, 2, 3];
try_to_modify_array(_array_orig , 100);
show_debug_message(_array_orig);

Manual Link

https://manual.gamemaker.io/beta/en/#t=GameMaker_Language%2FGML_Overview%2FValues_And_References.htm#pass_by_value_and_pass_by_reference

@juner juner added the docs-bug GameMaker Manual Bugs label Jan 31, 2025
@stuckie stuckie moved this from Triage to Backlog in Team Workload Jan 31, 2025
YYBartT added a commit to YoYoGames/GameMaker-Manual that referenced this issue Jan 31, 2025
YoYoGames/GameMaker-Bugs#9226

Fixed incorrect variable names passed to the functions in the code sample
@YYBartT YYBartT added this to the 2024.13 milestone Jan 31, 2025
@YYDan YYDan changed the title Sample code errors - Pass by Value and Pass by Reference Manual Content: Values And References page has two instances of missing "_orig" in its code sample Jan 31, 2025
@YYBartT
Copy link

YYBartT commented Jan 31, 2025

Changed variable names passed to the functions to the correct ones in the code example.

@YYBartT YYBartT closed this as completed Jan 31, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Team Workload Jan 31, 2025
@YYBartT YYBartT moved this from Done to Ready for QA in Team Workload Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-bug GameMaker Manual Bugs
Projects
Status: Ready for QA
Development

No branches or pull requests

3 participants