Search found 70 matches
- 20 Dec 2014, 08:29
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
Another way would be to add a command "ByRef", At the stage you call ByRef input , "input" doesn't contain a reference to the caller's variable, so what would you expect it to do? I would expect it to add such a reference, but I personally prefer the 1st suggested variant: adding ByRef to the argum...
- 20 Dec 2014, 08:27
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
Well you could do it the other way around, however you would have to rewrite the function and have it accept ByRef parameter(s). If you need to pass a variable not ByRef then you just have to pass an expression: v := "Hello World" f(v) f([v][1]) f(ByRef arg) { MsgBox % "arg is " . (IsByRef(arg) ? "...
- 12 Dec 2014, 00:21
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
I will, as soon as all commands that get some data and store it into a var will store the data into an object.
Why are you so against the proposed change?
How often do you make functions calls like func(byref var) so that the proposed change would break something for you?
Why are you so against the proposed change?
How often do you make functions calls like func(byref var) so that the proposed change would break something for you?
- 11 Dec 2014, 14:12
- Forum: Wish List
- Topic: Make 'Sort' support simple arrays
- Replies: 0
- Views: 1060
Make 'Sort' support simple arrays
Code: Select all
array := {5, 2, 6, 3, 8, 2, b, ac, b}
Sort, array, U
; array is now {2, 3, 5, 6, 8, ac, b}
- 11 Dec 2014, 13:48
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
Now, that second one is something you can already do with language constructs. nullify(ByRef input, ByRefyInput) { tmp := input tmp := 0 if ByRefyInput input := tmp } Yes, but that's an unwanted complication. I could as well duplicate the function: nullify(a, b){ a := b := 0 } nullifybyrefa(ByRef a...
- 11 Dec 2014, 13:36
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
Could you provide a context in which this would be useful? This lets to create way more universal functions and use less variables (and thus less memory and less manual garbage collections). result := multiply(multiplicator1, multiplicator2) multiply(ByRef result, multiplicator2) multiply(a, b){ a ...
- 11 Dec 2014, 13:31
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
Re: A way to force ByRef for an attribute in a function call
Another way would be to add a command "ByRef", that would quite act like "Global" or "Static" commands, buw would be usable only inside of a function: foo := 1 nullify(foo) MsgBox, %foo% ; 1 nullify(foo, 1) MsgBox, %foo% ; 0 nullify(input, ByRefyInput = 0) { If ByRefyInput ByRef input input := 0 }
- 11 Dec 2014, 13:22
- Forum: Wish List
- Topic: A way to force ByRef for an attribute in a function call
- Replies: 16
- Views: 4837
A way to force ByRef for an attribute in a function call
Provide a way to forcefully make an attribute a 'ByRef' from a call to a function with non-ByRef attribute:
The above script should yield 0, not 1.
Code: Select all
foo := 1
nullify(ByRef foo)
MsgBox, %foo%
nullify(input) {
input := 0
}
- 09 Dec 2014, 13:48
- Forum: Ask for Help (v1)
- Topic: [Resolved Invalid Issue] Broken built-in variable %0%
- Replies: 7
- Views: 1811
Re: [Resolved Invalid Issue] Broken built-in variable %0%
You are right, kon. Shame on me.
- 09 Dec 2014, 10:48
- Forum: Ask for Help (v1)
- Topic: [Resolved Invalid Issue] Broken built-in variable %0%
- Replies: 7
- Views: 1811
[Resolved Invalid Issue] Broken built-in variable %0%
Drag'n'drop n (where n > 1) files onto a script with such a code:
MsgBox should show n, but instead it shows the path to the 1 of the dropped files.
Bug happens to me on latest release version.
Edit: please, delete this topic.
Code: Select all
If (%0% != 0)
MsgBox, % %0%
Bug happens to me on latest release version.
Edit: please, delete this topic.