#include <file> syntax fails inside functions Topic is solved

Report problems with documented functionality
User avatar
RaptorX
Posts: 388
Joined: 06 Dec 2014, 14:27
Contact:

#include <file> syntax fails inside functions

Post by RaptorX » 02 Dec 2023, 14:46

Im not 100% sure this is a bug, but it appears to be.

I was testing with including a file in different locations of my script and found that when using #include with bracket (< / >) syntax, the include fails but not when using the path to the file (relative and absolute paths work fine).

for instance:

Code: Select all

Clean(txt)
{
	#Include <clean_words> ; this fails with error:  "AutoHotkey closed for the following exit code: 3221225477"
	; #Include .\lib\clean_words.ahk ; this works just fine, full path as well
	
	static repEndValue := map(
        ; Triming Words here
        "\bautohotkey\b"                 , "AHK",
        "the speaker"                    ,"Speaker",
		"\band\b"                            , "&",
	)

	for wrong,correct in repValues
		txt := RegExReplace(txt, 'im)' wrong, correct)
	
	for wrong,correct in repEndValue
		txt := RegExReplace(txt, 'im)' wrong, correct)

	return txt
}
I noticed this error code while using the debugger.
AutoHotkey closed for the following exit code: 3221225477
I dont get an AHK error, or any other feedback from autohotkey itself. Just a crash.
Projects:
AHK-ToolKit


Post Reply

Return to “Bug Reports”