Search found 89 matches
- 21 Dec 2019, 17:05
- Forum: Bug Reports
- Topic: [v2] Numeric Strings Can Be Falsey
- Replies: 8
- Views: 3016
Re: [v2] Numeric Strings Can Be Falsey
I see. While I personally don't think this is a good idea, I can see how this tradeoff was made. In my opinion, the best thing would be to have a dedicated Boolean type so that a cast (be it automatic or not) from a string to a bool could be handled differently than a cast from a number to a bool. T...
- 21 Dec 2019, 11:52
- Forum: Bug Reports
- Topic: [v2] Numeric Strings Can Be Falsey
- Replies: 8
- Views: 3016
[v2] Numeric Strings Can Be Falsey
When a value is required to be either true or false, a blank or zero value is considered false and all other values are considered true. This same sentence is present in the v1 docs, however, the behavior between the two versions differs. In v2, a numeric string is, seemingly, evaluated numerically...
- 18 Dec 2019, 16:05
- Forum: AutoHotkey Development
- Topic: [disappointed] Global language changes.
- Replies: 17
- Views: 5167
Re: [disappointed] Global language changes.
shorthand init must be myMap:= { expressionForKey1:expressionForVal1 ,expressionForKey2: ,:expressionForVal3 } ;any omitted keys or vals must be replaced with "" What do you think should happen with Objects? This clashes with the current Object syntax, so should Objects use Object() ? Also note tha...
- 18 Dec 2019, 12:53
- Forum: Ask for Help (v1)
- Topic: Custom Libraries of Functions issue Topic is solved
- Replies: 7
- Views: 1293
Re: Custom Libraries of Functions issue Topic is solved
I see. So for "directory-of-the-currently-running-AutoHotkey.exe\Lib\" the \lib must be in the directory of the script. No, for that it must be placed in the “directory-of-the-currently-running-AutoHotkey.exe”, not the script. But there are two more Lib locations, one of which is the script's locat...
- 18 Dec 2019, 12:17
- Forum: Ask for Help (v1)
- Topic: Custom Libraries of Functions issue Topic is solved
- Replies: 7
- Views: 1293
Re: Custom Libraries of Functions issue Topic is solved
I actually didn't even need the path in the function because the lib folder was in the same folder as the script. So to test, I moved the lib folder somewhere else. You can't move a Lib folder. There are three locations where AHK will look for library files, as described here . Any other location m...
- 18 Dec 2019, 11:51
- Forum: Ask for Help (v1)
- Topic: Custom Libraries of Functions issue Topic is solved
- Replies: 7
- Views: 1293
Re: Custom Libraries of Functions issue Topic is solved
You have written two MsgBoxes, so naturally there will be two MsgBoxes shown.
It looks like you want the function to return something:
It looks like you want the function to return something:
Code: Select all
FuncMsg(str)
{
return str " has"
}
- 18 Dec 2019, 11:29
- Forum: AutoHotkey Development
- Topic: [disappointed] Global language changes.
- Replies: 17
- Views: 5167
Re: [disappointed] Global language changes.
1. If I need performance I will use C++ or C#. 2. (old AHK state) mean like a103 where array == map. 3. I make some tests about Capacity and TRUE Length not equal to Capacity. This is understandable if I need 4 items let start with 4 items and don`t need to reallocate memory. 4. I think HAS must re...
- 18 Dec 2019, 10:48
- Forum: General Discussion
- Topic: AHK forum but no AHK button for code Topic is solved
- Replies: 4
- Views: 3358
- 18 Dec 2019, 10:39
- Forum: General Discussion
- Topic: AHK forum but no AHK button for code Topic is solved
- Replies: 4
- Views: 3358
Re: AHK forum but no AHK button for code Topic is solved
The “[code]” tags will properly highlight AHK code, no need to use the dropdown.
- 18 Dec 2019, 09:31
- Forum: AutoHotkey Development
- Topic: [disappointed] Global language changes.
- Replies: 17
- Views: 5167
Re: [disappointed] Global language changes.
Complete madness in arrays and maps: array:= [] loop 10 array[A_Index]:= A_Index ;Invalid Index ??? This simple code no more works. It must be something like: array:= [] loop 10 array.Push(A_Index) ;Is that a stack or ??? This is completely true, though I don't see how this is madness. It enforces ...
- 01 Dec 2019, 12:27
- Forum: Ask for Help (v1)
- Topic: ExitCode Topic is solved
- Replies: 7
- Views: 2903
Re: ExitCode Topic is solved
global CANT_OPEN_FILE_ERROR := 42 if cantopenfile1 error(CANT_OPEN_FILE_ERROR) SomeOtherFunc() { if cantopenfile2 error(CANT_OPEN_FILE_ERROR) } class SomeClass { __New() { if cantopenfile3 error(CANT_OPEN_FILE_ERROR) } } error(code) { if (code = CANT_OPEN_FILE_ERROR) { LogIt("hmmm") ExitApp } } In ...
- 01 Dec 2019, 10:40
- Forum: Ask for Help (v1)
- Topic: ExitCode Topic is solved
- Replies: 7
- Views: 2903
Re: ExitCode Topic is solved
In general, though, I don't see why this code you provided is at all useful. Why not call the functions directly? The script is exiting itself just to call functions, so why not call the functions directly and then exit (without registering OnExit)? it useful because it avoids duplication if ure go...
- 01 Dec 2019, 08:24
- Forum: Ask for Help (v1)
- Topic: ExitCode Topic is solved
- Replies: 7
- Views: 2903
Re: ExitCode Topic is solved
Any pre-execution error (such as a syntax error) causes the executable to exit with an exit code other than 0, typically 2, and OnExit is not called. There is nothing the script itself can do against this, it would require a ‘loader’. Also, in the rare event that the executable crashes, OnExit is no...
- 29 Nov 2019, 18:15
- Forum: Ask for Help (v2)
- Topic: check if a number is a valid Int64/Double
- Replies: 1
- Views: 1118
Re: check if a number is a valid Int64/Double
This works: string(largeint) == string(integer(largeint)) You can technically remove the first call to string() if you are certain that largeint is a string, but if it could also be a pure number, you need to leave it in. I recommend leaving it in either way. I'm up to explain stuff if you have any ...
- 12 Nov 2019, 16:54
- Forum: Scripts and Functions (v2)
- Topic: wait – Wait for any variable to become true or any function to evaluate to true
- Replies: 3
- Views: 3905
Re: wait – Wait for any variable to become true or any function to evaluate to true
I think this is a wonderful and it's great that you shared. Thank you! Please don't take this the wrong way, but I think putting just a function under GPL is unnecessary and even odd. It's arguably much better to put such under the MIT license (where it has your name as the copyright holder) or pub...
- 12 Nov 2019, 14:19
- Forum: Scripts and Functions (v2)
- Topic: wait – Wait for any variable to become true or any function to evaluate to true
- Replies: 3
- Views: 3905
wait – Wait for any variable to become true or any function to evaluate to true
Hi everyone! First time sharing code on the forums, so forgive me for any mistakes I may make. This function waits for the variable you pass in to become truthy, or for the function you pass in to return a truthy value. You can customize the interval at which it will run the check, as well as the ma...
- 29 Oct 2019, 09:23
- Forum: Ask for Help (v1)
- Topic: Very simple question that I can't figure out (new user) Topic is solved
- Replies: 1
- Views: 541
Re: Very simple question that I can't figure out (new user) Topic is solved
Code: Select all
Timeout := DllCall("GetDoubleClickTime")
$Space::
If (A_PriorHotkey == A_ThisHotkey && A_TimeSincePriorHotkey <= Timeout)
WinMinimize, A
Else
Send {Space}
- 06 Oct 2019, 11:21
- Forum: Ask for Help (v1)
- Topic: Loop Stopping
- Replies: 2
- Views: 443
Re: Loop Stopping
There is no loop in the code you are showing. You might be referring to the auto-repeat functionality of Windows that automatically repeats a key if you hold it down. But that stops sending the key when you press another key. This might be the effect you are observing, in which case there is not muc...
- 09 Sep 2019, 14:07
- Forum: Ask for Help (v1)
- Topic: operators: unary/binary/ternary
- Replies: 3
- Views: 698
Re: operators: unary/binary/ternary
Not sure if you want to include in and contains , since those are not actually operators in v1 and not yet operators in v2. is is fine, since it is an operator in v2 (not in v1 though). If you really want to list those pseudo-operators, then you should also include between as well as all the negated...
- 01 Sep 2019, 02:57
- Forum: Ask for Help (v1)
- Topic: terminology: object class terms in other programming languages
- Replies: 1
- Views: 490
Re: terminology: object class terms in other programming languages
I suggest adding the class name stored in __Class , the parent class (base class in AHK) you get by using extends , the this built-in, and mentioning that this.base is equivalent to most other languages' super built-in. Also, you can surely call __Init the “initializer”. That's all from my part. Tak...