Search found 3191 matches

by Helgef
25 Aug 2018, 07:37
Forum: Ask For Help
Topic: label does not pass through vertically stacked hotkeys?
Replies: 14
Views: 272

Re: label does not pass through vertically stacked hotkeys?

Why is AutoHotkey designed that way? Is that a feature intentionally added to AutoHotkey because it is somehow useful? Probably it is done this way to avoid the need to end the auto execute section with a return . Eg, you do not need to put a return above the hotkey in this script, a:: msgbox return
by Helgef
25 Aug 2018, 03:45
Forum: Ask For Help
Topic: label does not pass through vertically stacked hotkeys?
Replies: 14
Views: 272

Re: label does not pass through vertically stacked hotkeys?

Why is that? Note: While the script's first hotkey/hotstring label has the same effect as return, other hotkeys and labels do not. hence, it works as you want if you have another hotkey defined above the label, eg, gui, add, button, gbutton, test gui, show esc::exitapp button: msgbox, a F1:: F2:: F...
by Helgef
24 Aug 2018, 06:30
Forum: Ask For Help
Topic: Catch exception from timer Topic is solved
Replies: 5
Views: 89

Re: Catch exception from timer Topic is solved

OnError wrote: [v1.1.29+]
Update to latest AHK.
by Helgef
24 Aug 2018, 05:34
Forum: Ask For Help
Topic: Catch exception from timer Topic is solved
Replies: 5
Views: 89

Re: Catch exception from timer Topic is solved

onerror example,

Code: Select all

settimer f, 1000
onerror("catch_timer_error")

f(){
	static c := 0
	if (++c == 3)
		throw exception("count reached 3",, a_thisfunc)
	tooltip % "count: " c	
}

catch_timer_error(e){
	if (e.what == "f") {
		settimer f, off
		tooltip timer stopped
		return 1
	}
}

esc::exitapp
by Helgef
24 Aug 2018, 03:24
Forum: Ask For Help
Topic: Catch exception from timer Topic is solved
Replies: 5
Views: 89

Re: Catch exception from timer Topic is solved

You cannot catch an exception from another thread, you have to use try in the running thread. Also see [docs]OnError[/docs].

Cheers.
by Helgef
24 Aug 2018, 03:04
Forum: Ask For Help
Topic: How to directly check if an object key value is or not an Integer number? Topic is solved
Replies: 5
Views: 126

Re: How to directly check if an object key value is or not an Integer number? Topic is solved

Hello gregster :wave:.
gregster wrote:As far as I remember, this will be changed in AHK v2...
It is already changed ;)

Code: Select all

; v2, works as desired
x := []
x["n"] := "String"
if x["n"] is 'integer'
	MsgBox 'integer'
else 
	MsgBox 'not integer'
Cheers.
by Helgef
24 Aug 2018, 02:59
Forum: Scripts and Functions
Topic: Extending a class without using the keyword "extends"
Replies: 22
Views: 641

Re: Extending a class without using the keyword "extends"

the only logical place to put the boilerplate code is in __Init() or as an instance variable. Strictly speaking, __Init() is never the logical place to do anything, since the documentations says we shouldn't. Using a function might be more maintainable, f(o, p){ local outer := "", _class if ((_clas...
by Helgef
24 Aug 2018, 02:30
Forum: Wish List
Topic: Allow RegisterCallback with BoundFunc objects
Replies: 5
Views: 1586

Re: Allow RegisterCallback with BoundFunc objects

It would be kind of nice to be able to use methods directly for callbacks without having to code a dummy function outside the class (that calls the method...). You do not need a dummy function, [v1.1.06+]: A function reference can be passed instead of a function name. You pass the reference to the ...
by Helgef
24 Aug 2018, 02:17
Forum: Tips and Tricks
Topic: jeeswg's object classes tutorial
Replies: 3
Views: 255

Re: jeeswg's object classes tutorial

Hello jeeswg , impressive collection :shock:. Thanks for sharing :thumbup:. I only sifted through the top content, I'm sure there is a lot of good information here. - Key names can be of integer type (positive/0/negative) or string type. Note, Keys can be strings, integers or objects (my bold) Eg, o...
by Helgef
23 Aug 2018, 08:29
Forum: Scripts and Functions
Topic: Extending a class without using the keyword "extends"
Replies: 22
Views: 641

Re: Extending a class without using the keyword "extends"

nnnik wrote: Regardless i think this has a use for specific types of libraries and avoids using global space.
Yes I'm sure. I didn't mean to be too critical @iseahound.

Cheers :wave: .
by Helgef
23 Aug 2018, 05:58
Forum: Scripts and Functions
Topic: Extending a class without using the keyword "extends"
Replies: 22
Views: 641

Re: Extending a class without using the keyword "extends"

Well it's not like I would attempt to inherit from multiple classes - that is bound to fail and makes it impossible to maintain scripts. Indeed it cannot be done in a complete way, as I mentioned, there are limitations. Also the base := this.base does have an effect - just try it out. I know what i...
by Helgef
23 Aug 2018, 03:06
Forum: Scripts and Functions
Topic: Extending a class without using the keyword "extends"
Replies: 22
Views: 641

Re: Extending a class without using the keyword "extends"

It is not very meaningful to set the base of a more than once. You are also limited to linking a to b , if you also want a second class c , to have the methods of a and c , it doesn't work. I've used a very simple function for linking general base classes, with example, extend(o, bases*) { ; o exten...
by Helgef
22 Aug 2018, 04:46
Forum: Other Utilities & Resources
Topic: Best way to learn RegEx for AHK?
Replies: 13
Views: 2235

Re: Best way to learn RegEx for AHK?

Another link, which has a lot of content, jeeswg's RegEx tutorial (RegExMatch, RegExReplace).

Cheers.
by Helgef
21 Aug 2018, 01:11
Forum: Other Programming Languages
Topic: C++: AHK source code: demo functions
Replies: 7
Views: 343

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
20 Aug 2018, 16:54
Forum: Bug Reports
Topic: functions interpreting non-numeric strings as 0
Replies: 2
Views: 134

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: 87

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 := "test" might be the initial ...
by Helgef
17 Aug 2018, 02:19
Forum: AutoHotkey v2 Development
Topic: NumOp/StrOp (with respect to !=/!==)
Replies: 42
Views: 1048

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: 1048

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: 1048

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 ...

Go to advanced search