Search found 263 matches

by john_c
Today, 01:00
Forum: General Discussion
Topic: The performance of the parsing of file contents
Replies: 2
Views: 128

Re: The performance of the parsing of file contents

jeeswg > Try some benchmark tests. Yeah, it's all about benchmark tests. The question is: how to perform them properly. I'm not sure. > E.g. try each technique hundreds/thousands of times, and use A_TickCount before and after. The problem is that I'm trying to check the load on RAM and CPU. Not the...
by john_c
Yesterday, 10:57
Forum: General Discussion
Topic: The performance of the parsing of file contents
Replies: 2
Views: 128

The performance of the parsing of file contents

I'm working on a script that should parse a group of text files each 5 seconds. (Each file in the group should be checked against the existence of specific string, somewhere in the middle.) Consider this group as 5 files, each 200 lines, each line is 200 characters. The files are UTF-8. It is OK, fr...
by john_c
21 Sep 2019, 11:41
Forum: Ask For Help
Topic: Comparing variables with arrays Topic is solved
Replies: 1
Views: 91

Comparing variables with arrays Topic is solved

I'm trying to understand is it correct (i.e. is it possible) to compare variables with arrays, and how these comparisons work. Here are the tests: aaa := ["foo", "bar", "baz"] bbb := [] if (aaa != "") msgbox test 1 if (bbb = "") msgbox test 2 ;;;;;;;;;;;;;;;;;;;;;;;;; if (aaa != []) msgbox test 3 if...
by john_c
20 Sep 2019, 19:53
Forum: General Discussion
Topic: Notepad and UTF-8
Replies: 13
Views: 870

Re: Notepad and UTF-8

I'm not sure I understand the issue. I use Windows 7 and therefore I cannot say anything about Notepad in Win 8 or 10. In Windows 7, Notepad is horrible and nearly useless. * It doesn't have syntax highlighting at all * It has only "single" undo. * In case you are not native English speaker, it will...
by john_c
20 Sep 2019, 19:36
Forum: Ask For Help
Topic: Split array of files according to the paths Topic is solved
Replies: 4
Views: 192

Re: Split array of files according to the paths Topic is solved

@awel20 This is just awesome. I use your second version, looks perfect for my case.
by john_c
20 Sep 2019, 14:01
Forum: Ask For Help
Topic: Split array of files according to the paths Topic is solved
Replies: 4
Views: 192

Re: Split array of files according to the paths Topic is solved

flyingDman The paths aren't fixed in my case - they can be any. For example: Files := ["C:\Bar\Baz\q.txt", ...] ; and so on I have edited the question to reflect this point. Another thing that should be said is that only absolute paths are the thing of interest. ; Desired outcome: FilesFromFoo := [...
by john_c
20 Sep 2019, 12:18
Forum: Ask For Help
Topic: Split array of files according to the paths Topic is solved
Replies: 4
Views: 192

Split array of files according to the paths Topic is solved

I have an array of arbitrary files located in the arbitrary directories, something like Files := ["C:\Dir1\a.txt", "C:\Dir2\x.txt", "C:\Dir1\b.txt", "C:\Dir2\y.txt"] Is there a way to split this array according to the paths, i.e. something like For Index, File In Files { ... } ; Desired outcome: Fil...
by john_c
18 Sep 2019, 15:23
Forum: Ask For Help
Topic: A problem with nested for-loop
Replies: 3
Views: 171

Re: A problem with nested for-loop

> Move the inner loop to a function or use different names. Alternatively you could save the variables to a temporary one and restore it after the inner loop. The problem is that all these "ways" (except changing the names) makes the code hard-to-understand. This is the same problem that I have curr...
by john_c
18 Sep 2019, 14:30
Forum: Ask For Help
Topic: A problem with nested for-loop
Replies: 3
Views: 171

A problem with nested for-loop

I have one for-loop inside another one. Both of them have identical key-value names: Index , File . I understand that identical names are, probably, not a good idea, but I don't want to change them. (For a number of reasons. Actually, it is a part of quite large and complicated script.) The further ...
by john_c
15 Sep 2019, 19:03
Forum: Ask For Help
Topic: Mute returns from functions - should we avoid them?
Replies: 3
Views: 218

Re: Mute returns from functions - should we avoid them?

@jeeswg

> do you have any source for the term 'mute return'?

There is no source, I "created" this "term" myself. Another option would be "parameterless return".
by john_c
15 Sep 2019, 16:24
Forum: Ask For Help
Topic: Mute returns from functions - should we avoid them?
Replies: 3
Views: 218

Mute returns from functions - should we avoid them?

Are there any reasons to have functions like this one? Func(Var) { If (Var = "Foo") Return } In real life, it can has a lot of code. The key point is that it has only one exit point, and this exit point is mute. Here are another examples, to compare them with the first one: Func(Var) { If (Var = "Fo...
by john_c
11 Sep 2019, 17:24
Forum: Ask For Help
Topic: Taking elemts from arrays: dots vs. square brackets Topic is solved
Replies: 6
Views: 581

Re: Taking elemts from arrays: dots vs. square brackets Topic is solved

I use both forms. I think that [] looks better with numbers (linear arrays). I think that [] are the right thing for associative arrays. Book := {"Author": "John Doe", "Title": "Book Title", "Publication date": 1900} MsgBox,,, % Book["Title"] ; Works MsgBox,,, % Book["Publication date"] ; Works Msg...
by john_c
11 Sep 2019, 17:19
Forum: Ask For Help
Topic: What does "linear array" mean? Topic is solved
Replies: 5
Views: 637

Re: What does "linear array" mean? Topic is solved

- One thing I'm not sure about is if gaps are allowed: e.g. 1, 3, 5. No, gaps are not allowed. With gaps, it will be an associative array, not simple. Associative arrays can be sparsely populated - that is, {1:"a",1000:"b"} contains only two key-value pairs, not 1000. - https://www.autohotkey.com/d...
by john_c
10 Sep 2019, 13:15
Forum: Offtopic
Topic: Return from function - True or 1?
Replies: 27
Views: 2982

Re: Return from function - True or 1?

Flipeador If the function does not return any value, it makes no sense to use return . If the function is going to return an empty string, return "" can be more descriptive (personally I don't like to treat an empty string as "nothing" or as FALSE ). If your function is going to return only values ...
by john_c
06 Sep 2019, 10:10
Forum: Ask For Help
Topic: GUI with resizable text field Topic is solved
Replies: 14
Views: 793

Re: GUI with resizable text field Topic is solved

@tmplinshi Got it, thanks.
by john_c
06 Sep 2019, 06:37
Forum: Ask For Help
Topic: GUI with resizable text field Topic is solved
Replies: 14
Views: 793

Re: GUI with resizable text field Topic is solved

tmplinshi A small side question. Are you sure this part is necessary? if (A_EventInfo = 1) ; The window has been minimized. || (A_GuiWidth = lastGuiW && A_GuiHeight = lastGuiH) { ; The window has been restored (from minimized state) return } I have tried to remove it and it seems everything works j...
by john_c
05 Sep 2019, 17:49
Forum: General Discussion
Topic: What's your way to rename variables and functions?
Replies: 11
Views: 716

Re: What's your way to rename variables and functions?

@jeeswg Very interesting, thanks for sharing. I think it will be a great idea to create GUI utility for this.
by john_c
05 Sep 2019, 16:40
Forum: General Discussion
Topic: A request to change how hyperlinks works here
Replies: 4
Views: 333

Re: A request to change how hyperlinks works here

@Lexicos Thanks, I got it.

Go to advanced search