Search found 5943 matches

by jeeswg
12 Mar 2019, 10:58
Forum: Forum Issues
Topic: Reminding new members to use code tags
Replies: 28
Views: 683

Re: Reminding new members to use code tags

We should have a 'how to use the forum' video. That you are linked to when you join the forum.
by jeeswg
12 Mar 2019, 09:23
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

- @nnnik: I'm a little surprised that you aren't a fan of #Warm, because it promotes standard syntax principles e.g. explicitly assigning variables. - I wasn't interested in #Warn, but various people asked me to support it. Also, the default script, when you install AHK, uses #Warn. I want my script...
by jeeswg
12 Mar 2019, 08:29
Forum: Scripts and Functions
Topic: GUIs via DllCall: text functions (get/set internal/external control text)
Replies: 3
Views: 1463

Re: GUIs via DllCall: text functions (get/set internal/external control text)

- I've haven't seen that happen before. - Here's a fix that should suppress the error. 3 small changes. I use 'try' twice to suppress any error messages, I also assign the variable vRoleText as blank before trying to get text. HTH. ;before: vName := "", vValue := "" if IsObject(oKey) { vRoleText := ...
by jeeswg
12 Mar 2019, 08:19
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

- I almost never use global variables, but they can be handy for global hWnds or a global object that stores hWnds. The caveat being that the global object might need regular updating. - Yes, by explicitly stating 'global', your version of 'MyFunc2' is clearer. - Btw also, your 'MyFunc2' should be A...
by jeeswg
12 Mar 2019, 07:53
Forum: Offtopic
Topic: Object-Oriented Programming Is Bad?
Replies: 11
Views: 887

Re: Object-Oriented Programming Is Bad?

- Earlier today, I found perhaps the best ever article on the problems of OOP: Why bad scientific code beats code following "best practices" http://yosefk.com/blog/why-bad-scientific-code-beats-code-following-best-practices.html - Further discussion here: Why bad scientific code beats code following...
by jeeswg
12 Mar 2019, 06:13
Forum: Ask For Help
Topic: Debugging tutorials
Replies: 24
Views: 741

Re: Debugging tutorials

- And another thing ... - If you put multiple things on one line, comma-separated, the error message will tell you the line number, but it's harder to identify what caused the error. This happened to me once, I split the line up temporarily, and ran the script again, to get the same error message. -...
by jeeswg
12 Mar 2019, 02:31
Forum: Scripts and Functions
Topic: GDI+ standard library 1.45 by tic
Replies: 265
Views: 66181

Re: GDI+ standard library 1.45 by tic

- Hello, to support #Warn, changes like this need to be done for IntP/UIntP/PtrP etc in DllCall. I.e. you assign a value in advance. ;Warning: This variable has not been assigned a value. ;before: DllCall("Ole32.dll\CreateStreamOnHGlobal", "Ptr", hData, "Int", 1, "PtrP", pStream) ;after: pStream := ...
by jeeswg
12 Mar 2019, 02:09
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

- In a function, if I declare a variable as local, that means I want that variable to be local. It doesn't mean that I want all other variables in the function to be global. - IIRC, the more logical approach that I just described is default in AHK v2. - I agree that in a sense being able to declare ...
by jeeswg
12 Mar 2019, 01:40
Forum: Offtopic
Topic: « What's on your mind? »
Replies: 4139
Views: 560613

Re: « What's on your mind? »

Prof Stephen Hawking commemorated on new 50p coin - BBC News
https://www.bbc.co.uk/news/uk-england-cambridgeshire-47527505
by jeeswg
12 Mar 2019, 01:03
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

@swagfag and @DRocks: Yes, the behaviour re. local/global, totally surprised me as well, and I first found out about it, here: replace text maintain case - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=6&t=37328&p=171840#p171840 @DRocks: Re. you example: ;global is used, so Obje...
by jeeswg
12 Mar 2019, 00:58
Forum: Ask For Help
Topic: Regex to get a URL even from subdomains Topic is solved
Replies: 32
Views: 402

Re: Regex to get a URL even from subdomains Topic is solved

You need to 'escape' double quotes " -> "" in AHK v1, " -> `" in AHK v2, but that's a different kind of escape, relating to AutoHotkey. My 2 lists referred to when you need to add \ before a character to escape it, which is specific to RegEx.
by jeeswg
11 Mar 2019, 18:06
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

- I mentioned it here, but it's a classic sentence that will mean nothing until you experience it. Now you've experienced it. Debugging tutorials - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=5&t=62528&p=266682#p266682 - Thankfully I managed to put it on the agenda, and the 'l...
by jeeswg
11 Mar 2019, 15:43
Forum: Ask For Help
Topic: Excel-COM: Creating borders for a defined range of cells? Topic is solved
Replies: 10
Views: 181

Re: Excel-COM: Creating borders for a defined range of cells? Topic is solved

- Yes Scr1pter, #Warn can be a problem, it took me ages to fix all my scripts to avoid that problem. Mostly adding 'local' to functions, defining variables as blank or 0 in various places, and defining a variable before using IntP/PtrP etc in DllCall. - The problem is that so many AHK scripts were w...
by jeeswg
11 Mar 2019, 14:45
Forum: Ask For Help
Topic: if (expression OR expression) Syntax short-hand ? Topic is solved
Replies: 23
Views: 603

Re: if (expression OR expression) Syntax short-hand ? Topic is solved

This could work. Cheers. q:: ;check global variables var1 := "a" var2 := "b" var3 := "c" MyCheckVarFunc() MyCheckVarFunc2() MyCheckVarFunc2X() return MyCheckVarFunc() { global local vList := "var1,var2,var3" Loop, Parse, vList, % "," { if (%A_LoopField% = "b") MsgBox, % A_LoopField } } MyCheckVarFun...
by jeeswg
11 Mar 2019, 14:32
Forum: Ask For Help
Topic: Excel-COM: Creating borders for a defined range of cells? Topic is solved
Replies: 10
Views: 181

Re: Excel-COM: Creating borders for a defined range of cells? Topic is solved

#Warn is useful to warn if you used an xl constant without having defined it. Cheers.
by jeeswg
11 Mar 2019, 14:26
Forum: Ask For Help
Topic: [Looking for] JSON-Library for AHK V2-a100 Topic is solved
Replies: 13
Views: 351

Re: [Looking for] JSON-Library for AHK V2-a100 Topic is solved

- Thanks for the PR, lvalkov, and welcome to the forum. - I do hope that other users are now starting to see the benefits of AHK v1/v2 'bridging features', and will actively support me on their prioritisation. (Coincidentally I updated the top of my Wish List 2.0 earlier today.) - Specifically: Loop...
by jeeswg
11 Mar 2019, 12:30
Forum: AutoHotkey v2 Development
Topic: changing operators // and //= to only do integer or floor division
Replies: 9
Views: 819

Re: changing operators // and //= to only do integer or floor division

- If anyone had ever wondered about the odd behaviour of // in AHK v1, here's a summary. - I would like // in AHK v2 to behave like // in Python 3. - Btw you can use this link to run the Python 2/3 code: Online editor and compiler https://paiza.io/en normal division: x/y [float division, e.g. -3 / 2...
by jeeswg
11 Mar 2019, 11:24
Forum: Ask For Help
Topic: Regex to get a URL even from subdomains Topic is solved
Replies: 32
Views: 402

Re: Regex to get a URL even from subdomains Topic is solved

From here:
jeeswg's RegEx tutorial (RegExMatch, RegExReplace) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28031
12 characters that need escaping in RegEx generally: \.*?+[{|()^$
4 characters that need escaping in a RegEx character class: ^-]\
by jeeswg
11 Mar 2019, 10:14
Forum: Gaming
Topic: hot-swap between 2 AHK.exe files Topic is solved
Replies: 4
Views: 131

Re: hot-swap between 2 AHK.exe files Topic is solved

Evil-e + evilC :thumbup:

Code: Select all

MsgBox, % (var := "Evil-e")
MsgBox, % RegExReplace(var, "(....)..", "$L1C")
by jeeswg
11 Mar 2019, 09:46
Forum: Ask For Help
Topic: [Looking for] JSON-Library for AHK V2-a100 Topic is solved
Replies: 13
Views: 351

Re: [Looking for] JSON-Library for AHK V2-a100 Topic is solved

- What are the problems? Isn't it just Loop/InStr/SubStr, or is there something else? - I saw he put in some A_AhkVersion checks, and two-way compatible 'if var is type' uses. - Here are some functions for lazy InStr/SubStr conversion. ;================================================== ;works like ...

Go to advanced search