Issue information

Issue ID
#8222
Status
Working as Intended
Severity
None
Started
Poison
May 28, 2014 5:26
Last Post
Dastgir
May 28, 2014 6:06
Confirmation
N/A

Poison - May 28, 2014 5:26

[code=auto:0] - script test#a::nullscope -1,{ OnInit: .@i = 1; debugmes .@i; //Will show 1 callsub L_Test_1; callsub L_Test_2, .@i; end; L_Test_1: debugmes .@i; //Will show 0 return; L_Test_2: .@j = getarg(0); debugmes .@i; //Will still show 0 debugmes .@j; //Will show 1 return; } [/code]

Please confirm, thank you.

This post has been edited by Poison on May 28, 2014 5:26

Dastgir - May 28, 2014 5:44

If I am not wrong, calling a function from callfunc or callsub causes to start a new scope.[quote]
".@" - A scope variable.
They are unique to the character, script and scope. Each script
execution has its own scope that ends when the script ends.
[color=#ff0000][b]Calling a function with callsub/callfunc starts a new scope,
returning from the function ends it.[/b][/color] When a scope ends, its
variables are converted to values ('return .@var;' returns a
value, not a reference).[/quote]

This post has been edited by Dastgir on May 28, 2014 5:45

Poison - May 28, 2014 5:47

Thank you for confirming. This bug report is working as intended if that is the case.