Search found 3097 matches

by Helgef
Today, 01:11
Forum: Other Programming Languages
Topic: C++: AHK source code: demo functions
Replies: 2
Views: 34

Re: C++: AHK source code: demo functions

- A known issue that needs to be addressed for some functions:

You can use ParamIndexToNumber instead of ParamIndexToInt and take whatever measures you like on invalid input.
by Helgef
Yesterday, 16:54
Forum: Bug Reports
Topic: functions interpreting non-numeric strings as 0
Replies: 2
Views: 43

Re: functions interpreting non-numeric strings as 0

It is a bug, in your code, you are not using the functions as documented. The parameters are documented as numbers. Unless there is any documentation stating that parameters are verified, this is not a bug in the program, but rather a limitation of the implementation, or a design choice if you like....
by Helgef
17 Aug 2018, 02:27
Forum: Ask For Help
Topic: Release binary variable
Replies: 3
Views: 64

Re: Release binary variable

Hello :wave:. Yes it is normal. To free a variable you either do varsetcapacity b, 0 or b := "" , that is, store an empty string. Not freeing when you do b := "test" is important because you might have set the capacity in anticipation of multiple concatenations, and b := "te...
by Helgef
17 Aug 2018, 02:19
Forum: AutoHotkey v2 Development
Topic: NumOp/StrOp (with respect to !=/!==)
Replies: 42
Views: 736

Re: NumOp/StrOp (with respect to !=/!==)

What are your arguments? You have only repeated what was already said on github. So why did we need this thread, and why shouldn't we have used github? Please do not answer that, we have achieved nothing . - But using an operator is less verbose, and I usually only want 2 results (yes/no). You say ...
by Helgef
15 Aug 2018, 11:43
Forum: AutoHotkey v2 Development
Topic: NumOp/StrOp (with respect to !=/!==)
Replies: 42
Views: 736

Re: NumOp/StrOp (with respect to !=/!==)

Hello all :wave:. you should outline the proposals in full, in one place. I did, on github. I now see further disadvantages You talk about problems, but you are not very specific, or is it just this again? These kind of changes, re. types, could have the highest rewrite costs of any changes suggeste...
by Helgef
14 Aug 2018, 11:48
Forum: AutoHotkey v2 Development
Topic: NumOp/StrOp (with respect to !=/!==)
Replies: 42
Views: 736

Re: NumOp/StrOp (with respect to !=/!==)

However, one side effect is that !(var1 != var2), dependent on A_StringCaseSense, is no longer available, with no good alternative at present. AutoHotkey v2 aims to improve the usability and convenience of the language src Non-sensical operator games are not very usable or convenient, and also not ...
by Helgef
13 Aug 2018, 11:14
Forum: Wish List
Topic: A_MajorAHKVersion
Replies: 5
Views: 78

Re: A_MajorAHKVersion

I do not think many people wants to make much or hardly any effort at all for something like that.
by Helgef
13 Aug 2018, 10:59
Forum: Ask For Help
Topic: v1/v2 Random for both
Replies: 16
Views: 212

Re: v1/v2 Random for both

This will be easy to solve if v2 can get a reference to built in functions even when a function with the same name has been defined in the script. Pseudo code, random(p*){ static rs := func("randomseed") static r := func( (rs ? ["random", builtin_only := true] : [""])* ...
by Helgef
13 Aug 2018, 10:47
Forum: Wish List
Topic: A_MajorAHKVersion
Replies: 5
Views: 78

Re: A_MajorAHKVersion

Maybe #include syntax in v2 will change. V2 shouldn't keep the syntax just to be compatible with v1. So I'd ask that before I'd make this wish.

Cheers.
by Helgef
13 Aug 2018, 09:34
Forum: Ask For Help
Topic: v1/v2 Random for both
Replies: 16
Views: 212

Re: v1/v2 Random for both

Then you need to #include *i random.ahk for v1 users, or find an api function to do random numbers.

I have no other ideas.

Cheers
by Helgef
13 Aug 2018, 09:23
Forum: Ask For Help
Topic: v1/v2 Random for both
Replies: 16
Views: 212

Re: v1/v2 Random for both

f(min, max){ static r := func("random") static r_min := -2147483648.0 static r_max := 2147483647.0 local if !r { ; v1 random out, r_min ; [r_min, r_max] -> [min, max] out := (out - r_min) * (max - min) / (r_max-r_min) + min int_res := 0 if min is integer int_res++ if max is integer int_re...
by Helgef
13 Aug 2018, 03:56
Forum: Ask For Help
Topic: v1/v2 Random for both
Replies: 16
Views: 212

Re: v1/v2 Random for both

I guess this would work,

Code: [Select all]GeSHi © Codebox Plus

; lib\random.ahk 
Random(min, Max){
Local
Random r, min, Max
Return r
}

it will be auto included in v1 because the function doesn't exist, in v2 it will not. To seed, do similar.

Cheers.
by Helgef
12 Aug 2018, 13:35
Forum: Ask For Help
Topic: How to create static var inside class that is separate from any other initialized object? Topic is solved
Replies: 2
Views: 40

Re: How to create static var inside class that is separate from any other initialized object? Topic is solved

Code: [Select all]GeSHi © Codebox Plus

this.setcapacity("buf", _size)
this.adr := this.getaddress("buf")

It doesn't initialise the memory to zero though.

Cheers.
by Helgef
12 Aug 2018, 09:07
Forum: AutoHotkey v2 Development
Topic: String to number
Replies: 11
Views: 157

Re: String to number

You might be interested in this topic.
by Helgef
12 Aug 2018, 08:17
Forum: AutoHotkey v2 Development
Topic: String to number
Replies: 11
Views: 157

Re: String to number

There are two (suitable) functions available, integer and float.
by Helgef
12 Aug 2018, 06:36
Forum: Ask For Help
Topic: Question about Class variables
Replies: 2
Views: 51

Re: Question about Class variables

See object properties and syntax remarks . Example, class c { Option[k]{ set { return this.opt[k] := value } get { return this.opt[k] } } } c.option(6) := false msgbox % c.option(6) Also note the difference in which meta-functions will be invoked (when using an object derived from the class) for the...
by Helgef
10 Aug 2018, 03:07
Forum: Ask For Help
Topic: Changing case for a string
Replies: 5
Views: 79

Re: Changing case for a string

Hello, maybe something like this,

Code: [Select all]GeSHi © Codebox Plus

f(str){
return regexreplace(str, "(?=\d+)(\w+)", "$L1")
}
msgbox % f("101M, 24M, 102,354M 123FT")
by Helgef
10 Aug 2018, 02:54
Forum: Ask For Help
Topic: [ahkv2] how to if var in/contains matchlist Topic is solved
Replies: 3
Views: 71

Re: [ahkv2] how to if var in/contains matchlist Topic is solved

It is not implemented in v2 (yet?) You can use a custom function, eg, var_in(var, list){ if type(list) == 'String' list := strsplit(list, ',') for k, v in list if var = v return k return false } ; Example var := 'cat' if var_in(var, 'dog,parrot,fish,apple,cat') msgbox 'yes' var := 2 if var_in(var, [...
by Helgef
09 Aug 2018, 06:09
Forum: Ask For Help
Topic: #Include <LibName> v. auto-include Topic is solved
Replies: 4
Views: 119

Re: #Include <LibName> v. auto-include Topic is solved

Hello jeeswg :wave:. You haven't stated anything incorrect about the conclusion, so I can't agree or disagree. I was referring to what I quoted. I'll address you explicit conclusion, In conclusion, an auto-include 'includes' a script, in the sense that all of its functions are made available for use...
by Helgef
09 Aug 2018, 02:09
Forum: Ask For Help
Topic: #Include <LibName> v. auto-include Topic is solved
Replies: 4
Views: 119

Re: #Include <LibName> v. auto-include Topic is solved

;script 1A ;shows 1 then 4 MsgBox, 1 #Include <MyPrefix_MyFunc> MsgBox, 4 ;================================================== ;script 1B ;shows 1 2 3 4 MsgBox, 1 MyPrefix_MyFunc() MsgBox, 4 Your comments are swapped. It seems that with both approaches (#Include <LibName> and auto-include), the incl...

Go to advanced search