I have long ago created a workaround for this problem. A precompiler that regularly scans my include files and hardcoded the addresses in those places. But of course I do not always have this script with me and of course I would prefer a more elegant solution. An idea?
Besides, my solution is not bidirectional, not very flexible. If I change the name of the include file, the entries are not updated automatically. Of course you could also program it into the precompiler ...
BTW: https://www.google.de/search?q=autohotk ... ncludefile
get name of include file
get name of include file
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
- Delta Pythagorean
- Posts: 627
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: get name of include file
A_LineFeed I think is what you're wanting.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
Re: get name of include file
To get a list of all included files (if that's what your asking), I might do something like this. Add this function to all files, but with a different name each time.
And then to retrieve the filenames:
Code: Select all
Inc1()
{
static vDummy := Inc1()
;static vDummy := %A_ThisFunc%() ;doesn't work
global oInc
if IsObject(oInc)
oInc.Push(A_LineFile)
else
oInc := [A_LineFile]
}
Code: Select all
q::
vOutput := ""
for vKey, vValue in oInc
vOutput .= vKey " " vValue "`r`n"
MsgBox, % vOutput
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: get name of include file
There is A_LineFile, but no A_LineFeed.Delta Pythagorean wrote:A_LineFeed I think is what you're wanting.
Re: get name of include file
YES thats it!! thanks all! i not believed it!!! is this a new feature?A_LineFile
Code: Select all
ScriptNameLine := % SubStr(A_LineFile,InStr(A_LineFile,"\",,0)+1)
Code: Select all
; A_LineFile0.ahk :
Clipboard := A_LineFile . "`n"
; A_LineFile1.ahk
#Include,A_LineFile0.ahk
Clipboard .= A_LineFile . "`n"
MsgBox,% Clipboard
result =
(
....\A_LineFile0.ahk
....\A_LineFile1.ahk
)
Last edited by SL5 on 27 Feb 2018, 09:43, edited 1 time in total.
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: get name of include file
I guess this use for A_Linefile was added in 1.1.11.00 - June 21, 2013is this a new feature?
- Delta Pythagorean
- Posts: 627
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: get name of include file
Ack. Forgive me, I just woke upgregster wrote:There is A_LineFile, but no A_LineFeed.Delta Pythagorean wrote:A_LineFeed I think is what you're wanting.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
Re: get name of include file
A linefeed, `n.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: RandomBoy and 245 guests