I wrote 2 functions:
Floor/Ceil able to handle decimal places (cf. Excel's Trunc function) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=41539
Do notify of any issues. Thanks.
Search found 6899 matches
- 20 Nov 2019, 00:50
- Forum: Ask for Help (v1)
- Topic: Ceil() with precision Topic is solved
- Replies: 23
- Views: 3868
- 19 Nov 2019, 18:11
- Forum: Ask for Help (v1)
- Topic: How to remove systray icon after process was closed?
- Replies: 6
- Views: 2468
Re: How to remove systray icon after process was closed?
Here's a script with no dependencies: q:: ;systray - remove icons for closed processes ;warning: the script remotely accesses the memory of explorer.exe, so could potentially crash it ;tested on Windows 7 DetectHiddenWindows, On WinGet, hWnd, ID, ahk_class NotifyIconOverflowWindow ControlGet, hCtl, ...
- 19 Nov 2019, 09:30
- Forum: AutoHotkey Development
- Topic: v2 breaking changes policy Topic is solved
- Replies: 25
- Views: 10232
Re: v2 breaking changes policy Topic is solved
@Helgef: I enjoyed your post, but it's not clear what you want to change, or how it would be helpful. The problem with AHK is simply that projects in general are complex, and I don't think that formalising a release policy will be helpful here. From my perspective, the idea that once I release somet...
- 19 Nov 2019, 08:39
- Forum: AutoHotkey Development
- Topic: v2 breaking changes policy Topic is solved
- Replies: 25
- Views: 10232
Re: v2 breaking changes policy Topic is solved
@Helgef: That sounds pretty much like the existing policy. AHK v1. 1 had some breaking changes, and AHK v1. 2 /v2. 1 could have breaking changes also. One potentially useful change: a 1-year window, where new features could be changed before being set in stone. @guest3456: You mention 'fix the quirk...
- 18 Nov 2019, 10:50
- Forum: Ask for Help (v1)
- Topic: Internet Explorer: Memory (Private Working Set)
- Replies: 0
- Views: 463
Internet Explorer: Memory (Private Working Set)
I have a script that: uses Internet Explorer to navigate to various urls, does stuff, then closes. But the Memory (Private Working Set), as seen in Task Manager, rises quite rapidly. The memory increases steadily for each url, but never appears to decrease. It soon reaches figures of about 1.4 GB, a...
- 17 Nov 2019, 01:27
- Forum: Ask for Help (v2)
- Topic: AHK v2 source code: identify version number
- Replies: 5
- Views: 2741
Re: AHK v2 source code: identify version number
@lexikos: Thanks. Some info re. the names of zip files: To download official releases: [recommended: e.g. AutoHotkey_L-2.0-a107.zip, AutoHotkey_L-1.1.31.01.zip] Releases · Lexikos/AutoHotkey_L · GitHub https://github.com/Lexikos/AutoHotkey_L/releases To download the latest AHK v2 release: [warning: ...
- 16 Nov 2019, 21:36
- Forum: Ask for Help (v1)
- Topic: Problems with finding space character
- Replies: 6
- Views: 2474
Re: Problems with finding space character
In line with what guest3456 said, consider changing your script to this: if InStr(Clipboard, " `n") || InStr(Clipboard, " `r") Which program(s) are you referring to re. 'move the caret while holding shift key'? Here's a script to list unique characters: ;list unique characters vText := Clipboard vTe...
- 16 Nov 2019, 20:30
- Forum: Ask for Help (v1)
- Topic: obs studio start and record
- Replies: 7
- Views: 10271
Re: obs studio start and record
I found a way to toggle 'Start Recording'/'Stop Recording', that has been working reliably for me, whether the window is visible or hidden. It works like so: - Create an Acc object for the Start/Stop Recording GUI element, by specifying an Acc path of 4.8.1.2 (obtained via the JEE_AccGetTextAll func...
- 14 Nov 2019, 19:59
- Forum: Ask for Help (v1)
- Topic: ACC.AHK - Get IAccessible for Context menu
- Replies: 17
- Views: 8111
Re: ACC.AHK - Get IAccessible for Context menu
- @sancarn: I've been doing various tests with Acc. - Most of the time I haven't been able to get anything useful out of the accChild method. - Typically these fail: oAcc.accChild(n) and Acc_Child(oAcc, n) (from Acc.ahk), as do attempts to call the vtable directly via DllCall. - When I test on a chi...
- 14 Nov 2019, 18:42
- Forum: Bug Reports
- Topic: bug? Hotstring using just a colon
- Replies: 7
- Views: 3929
Re: bug?
Just FYI, by writing a function like this, you can define a hotstring anywhere in a script, versus being forced to define it in the auto-execute section.
Code: Select all
MyHotstring()
{
static vDummy := MyHotstring()
Hotstring(":*::", "abc")
}
- 13 Nov 2019, 19:44
- Forum: Ask for Help (v1)
- Topic: BoundFunc Object, .Bind() parameter variadic syntax: Preserve function paramter type
- Replies: 3
- Views: 665
Re: BoundFunc Object, .Bind() parameter variadic syntax: Preserve function paramter type
Perhaps something like this: aParams := [] sParams := "true, 123, ""Hello""" MsgBox, % sParams ;true, 123, "Hello" for vKey, vValue in StrSplit(sParams, ", ") { if RegExMatch(vValue, "s)^\x22.*\x22$") aParams.Push("" SubStr(vValue, 2, -1)) else if (vValue = "true") aParams.Push(1) else if (vValue = ...
- 13 Nov 2019, 19:17
- Forum: Ask for Help (v1)
- Topic: FileSelectFile(Save) on Read-Only Files Topic is solved
- Replies: 24
- Views: 5524
Re: FileSelectFile(Save) on Read-Only Files Topic is solved
I've added these lines to the q:: example: oFilters := ["Text Documents (*.txt)", "*.txt", "All Files", "*.*"] VarSetCapacity(ArrayCOMDLG_FILTERSPEC, oFilters.Length()*A_PtrSize) Loop % oFilters.Length() { VarSetCapacity(vFilter%A_Index%, StrLen(oFilters[A_Index])*2+2) StrPut(oFilters[A_Index], &vFi...
- 12 Nov 2019, 17:31
- Forum: Ask for Help (v1)
- Topic: recreating AHK v2's ComCall function
- Replies: 11
- Views: 1717
Re: recreating AHK v2's ComCall function
'OUTPUT' VARIABLES - Ah yes, in my testing, I hadn't come across the problem of 'output' variables yet. (Do you have another name for this?) - A workaround is to use 'Ptr' and avoid special types such as 'Int*'/'Str'. - (Otherwise AHK v1 could be given either: ComCall (officially), or, some form of ...
- 12 Nov 2019, 16:41
- Forum: C/C++
- Topic: #pragma pack and struct offsets/sizes
- Replies: 0
- Views: 8046
#pragma pack and struct offsets/sizes
- In general: - The basic rules are the same for both 64-bit and 32-bit processes. - An n-byte parameter must start at an n-byte offset. - The overall size of the struct must be divisible by the size of the biggest parameter. - However, I came across around 9-11 structs where this is not the case, t...
- 12 Nov 2019, 11:10
- Forum: Ask for Help (v1)
- Topic: Remove duplicates from a string Topic is solved
- Replies: 31
- Views: 5878
Re: Remove duplicates from a string Topic is solved
@john_c: Re. why I prepended 'z' to the key names, see: KEY NAMES THAT CLASH WITH METHOD NAMES jeeswg's objects tutorial - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=7&t=29232 Also, in the tutorial, I've fixed the Sort line: ;before: ;Sort, vText, CS ;add this line to sort th...
- 12 Nov 2019, 08:42
- Forum: Ask for Help (v1)
- Topic: dynamic function calls silently fail
- Replies: 8
- Views: 1800
Re: dynamic function calls silently fail
I've tweaked it to list all parameters passed. It's been really useful for catching non-existent functions/methods. Thanks Helgef. OnCallNonFunc(oParams*) { local static vIsReady := 0, vDummy := OnCallNonFunc("") vText := "" for vKey, vValue in oParams vText .= "`r`n" vKey " " vValue if vIsReady thr...
- 12 Nov 2019, 08:30
- Forum: Suggestions on Documentation Improvements
- Topic: [Archived, Locked] Suggestions on documentation improvements
- Replies: 688
- Views: 295223
Re: Suggestions on documentation improvements
since the command's behaviour (0 implies 0.5) is so senseless, the human brain will try to fix it Great description. Attempts to ponder what the behaviour is, and why, could last half-an-hour or more. As I told you, that doesn't say that the minimum is 0.5 , that was your erroneous interpretation. ...
- 11 Nov 2019, 19:59
- Forum: Ask for Help (v1)
- Topic: recreating AHK v2's Integer function
- Replies: 3
- Views: 758
Re: recreating AHK v2's Integer function
Thanks lexikos. In short, starting with the principle of: avoid NumGet/NumPut unless needed, had overcomplicated things. Also, it wasn't immediately obvious that the UInt64 option could handle a negative to positive range, 1.5 times larger than Int64. I have this now, based on your 'Integer2' functi...
- 11 Nov 2019, 19:22
- Forum: Ask for Help (v1)
- Topic: recreating AHK v2's ComCall function
- Replies: 11
- Views: 1717
Re: recreating AHK v2's ComCall function
This will not work with output variables (there is no really good solution for that). What are you referring to? V1 comobjs have no ptr property if I'm not mistaken, I guess you could use comobjvalue instead. Yes, I meant to relook at this. So ... Ptr := IsObject(ComObject) ? ComObject.Ptr : ComObj...
- 11 Nov 2019, 14:46
- Forum: Suggestions on Documentation Improvements
- Topic: [Archived, Locked] Suggestions on documentation improvements
- Replies: 688
- Views: 295223
Re: Suggestions on documentation improvements
- @swagfag: Nice use of 'clamped'. - script2.cpp says this, I half-agree, however, they didn't consider WaitForAnyData, i.e. if the clipboard is *completely* empty: // Waiting 500ms in place of a "0" seems more useful than a true zero, which // doesn't need to be supported because it's the same thin...