I'm not sure if I'm looking the right places within the documentation:
A VarRef can be used to assign to the original target variable or retrieve its value by dereferencing it.
So how can a VarRef be assigned a new value?
Code: Select all
var := 123
fn(&var)
MsgBox var
fn(var) {
; check if a varref is passed, and if so change the value
if IsSetRef(var)
; assign a new value to the varref
; otherwise return the different value.
}
Edit: In case this question is not clear, using
fn(&var) => (var := 456) is not the solution I am looking for. I am asking whether the VarRef object contains some "value" parameter that can be directly set. Using ObjOwnProps to inspect a VarRef object fails, as it shows "expected an object not a varref" or something like that.