Search found 150 matches

by freespacing
15 Apr 2019, 11:13
Forum: AHK Studio
Topic: AHK Studio
Replies: 1179
Views: 618968

Re: AHK Studio

Three questions all related to the fabulous Project Explorer ! 1. In the Project's File Browser, is it possible to sort the files by name ? They show up in order of having been opened. Refreshing the project explorer doesn't fix this. 2. When the included files are specifically open, they show up be...
by freespacing
15 Apr 2019, 10:17
Forum: AHK Studio
Topic: [Solved] How to browse functions in library file?
Replies: 1
Views: 4254

Re: How to browse functions in library file?

Haaaa… Finally got it. It's not enough to reference the file as an Include in the master file. Yes, that will make the functions available, but only by browsing the master file's functions in the code browser. What's needed is to specifically open the library file also in AHK Studio (for instance, R...
by freespacing
15 Apr 2019, 10:03
Forum: AutoHotkey Development
Topic: Why PCRE instead of PCRE2?
Replies: 7
Views: 5269

Re: Why PCRE instead of PCRE2?

I totally get why we're sticking with PCRE1 — everyone's code would break. One question, though. On the PCRE1 branch, there have been a lot of bug fixes since version 8.30 (Feb 2012) that AHK is on. This table summarizes nicely the changes between PCRE versions , while this is the whole boring chang...
by freespacing
15 Apr 2019, 05:15
Forum: AHK Studio
Topic: AHK Studio
Replies: 1179
Views: 618968

Re: AHK Studio

DuyMinh wrote:
15 Apr 2019, 02:49
I can't write unicode character in AHK Studio.
Did you try Alt-M, then "Force UTF-8"?
by freespacing
14 Apr 2019, 09:23
Forum: AHK Studio
Topic: [Solved] How to browse functions in library file?
Replies: 1
Views: 4254

[Solved] How to browse functions in library file?

Howdy Maestrith, Hope your weekend started well. It's Sunday, obviously not an urgent question. :) A couple weeks ago, I started using AHK studio, and have been really impressed so far. A bit of a learning curve of course, but that's the same with PyCharm, Visual Studio, any sophisticated IDE. Huge ...
by freespacing
13 Apr 2019, 06:24
Forum: Ask for Help (v1)
Topic: Four unique random integers between one and ten?
Replies: 10
Views: 1749

Re: Four unique random integers between one and ten?

Great tip on VarSetCapacity . I like how you got started on a sizing formula. My sense is it would have to be a bit more complex than this: (how_many_to_pick_from * 2) * (A_IsUnicode ? 2 : 1) That's because according to the docs, the string size is set in bytes… Now let's say the max is 300. For eac...
by freespacing
13 Apr 2019, 04:49
Forum: Ask for Help (v1)
Topic: Four unique random integers between one and ten?
Replies: 10
Views: 1749

Re: Four unique random integers between one and ten?

just me Thank you for the improvement, makes a lot of sense, love it. Also great to learn about SetCapacity , I imagine that otherwise the array expands dynamically every time it doubles in size… But maybe not as this test shows the capacity increasing one by one. a := [] Loop 100000 { tmp := A_Ind...
by freespacing
12 Apr 2019, 09:01
Forum: Ask for Help (v1)
Topic: Four unique random integers between one and ten?
Replies: 10
Views: 1749

Re: Four unique random integers between one and ten?

Hi again. Spent the day reading the manual. I had and still have an enormous amount to run. But at least some basics about the available data structures are a lot clearer for me now. For anyone looking for a quick solution to the question in the top post, here is a function based on swagfag 's idea,...
by freespacing
12 Apr 2019, 01:05
Forum: Ask for Help (v1)
Topic: Four unique random integers between one and ten?
Replies: 10
Views: 1749

Re: Four unique random integers between one and ten?

Thank you so much, all three of you. You have shown a variety of approaches that I'm excited to study thoroughly. I feel really crippled not having a handle on the data structures in AHK, and this is the kick in the butt to start to remedy that. @swagfag Thank you very much for the much-needed lesso...
by freespacing
11 Apr 2019, 18:19
Forum: Ask for Help (v1)
Topic: Four unique random integers between one and ten?
Replies: 10
Views: 1749

Four unique random integers between one and ten?

EDIT : this post lower in the thread has a solution in function form based on the ideas of @swagfag. Needing to draw x unique random integers within a range. Before generalizing, let's start with a concrete example: 4 unique random integers between 1 and 10. My first challenge is that I don't know ...
by freespacing
11 Apr 2019, 05:13
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Re: Tool to diagnose why/where a long script is stuck?

Just found one place where the script was sometimes hung: ClipWait When restoring the clipboard, there were places where I had a ClipWait, but the clipboard was initially empty, so it just stayed there. This is telling me to use something like ClipWait, 0.5 most of the time as a safety feature. I im...
by freespacing
10 Apr 2019, 10:37
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Re: Tool to diagnose why/where a long script is stuck?

swagfag Thank you for your compliment, I appreciate it. @Everyone Else Thank you for your helpful suggestions. An update is in order. I've realized that I needed to take a step back to inform myself about debugging facilities in AHK, something I'd never studied. This has been extremely interesting,...
by freespacing
09 Apr 2019, 13:08
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Re: Tool to diagnose why/where a long script is stuck?

jeeswg wrote:
09 Apr 2019, 13:05
I think some of the editors have debugging functionality.
You could also use ListLines.
Thank you very much for those ideas, @jeeswg
I will look into them.
Interested in exploring anything that provides some introspecting ability.
by freespacing
09 Apr 2019, 13:03
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Re: Tool to diagnose why/where a long script is stuck?

swagfag wrote:
09 Apr 2019, 11:38
the fact that u got no clue at all as to what might be causing it is more concerning to me. its spaghetti, bon apetit
Then I saw you wrote

Code: Select all

str := RegExReplace(str, "([0-9])\.([0-9])", "$1ZZZZ$2")
where I would have done

Code: Select all

str := RegExReplace(str, "[0-9]\K\.(?=[0-9])", "ZZZZ")
and I yawned.
by freespacing
09 Apr 2019, 11:34
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Re: Tool to diagnose why/where a long script is stuck?

You need to rewrite your code. Refactor and refactor. The fact that you have issues has nothing to do with any lack of diagnostic tools. But rather you need to step back, create a new file, and copy and paste the bits that work, look for patterns and abstract them into functions, then turn your fun...
by freespacing
09 Apr 2019, 10:24
Forum: Ask for Help (v1)
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 2336

Tool to diagnose why/where a long script is stuck?

I have a very long script (1,800 lines and growing) that gets called via various entry points. There are no permanent states such as defined hotkeys or CapsLock, and usually the script exits okay. But quite often, the script fails to exit. The reason I know this is that: With #SingleInstance force ,...
by freespacing
08 Apr 2019, 07:17
Forum: Ask for Help (v1)
Topic: "Clipboard :=" does not always empty the clipboard immediately Topic is solved
Replies: 33
Views: 15154

Re: "Clipboard :=" does not always empty the clipboard immediately Topic is solved

…and your home page is at the top of my AHK bookmarks. What an outstanding resource. Have a great week.
by freespacing
07 Apr 2019, 12:17
Forum: Ask for Help (v1)
Topic: "Clipboard :=" does not always empty the clipboard immediately Topic is solved
Replies: 33
Views: 15154

Re: "Clipboard :=" does not always empty the clipboard immediately Topic is solved

@jeeswg quick thought: it might be worth mentioning this method at the top of your PasteWait thread so that people who need help find a working solution fast without falling down the rabbit hole… Less work for you and others who are so active on the forum. This issue had been plaguing me for years, ...
by freespacing
07 Apr 2019, 12:08
Forum: Ask for Help (v1)
Topic: "Clipboard :=" does not always empty the clipboard immediately Topic is solved
Replies: 33
Views: 15154

Re: "Clipboard :=" does not always empty the clipboard immediately Topic is solved

Thank you for clarifying. That sounds valuable. Edited the "docstring" in SafeClear.
by freespacing
07 Apr 2019, 11:32
Forum: Ask for Help (v1)
Topic: "Clipboard :=" does not always empty the clipboard immediately Topic is solved
Replies: 33
Views: 15154

Re: "Clipboard :=" does not always empty the clipboard immediately Topic is solved

Are you saying that you would like to see a post with a list like this for people to test? Not sure what key WM_CLEAR would normally correspond to, so description is more brief. ;--------------- SafePaste SafePaste() { ; A way of pasting that only returns control when the paste is complete ; by jees...

Go to advanced search