A syntax error Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Hobby77
Posts: 30
Joined: 25 Jan 2021, 01:27

A syntax error

Post by Hobby77 » 24 Mar 2023, 06:35

A syntax error
#include <libName>is used inconsistently in the documentation. The lib folder is not recognized

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: A syntax error

Post by boiler » 24 Mar 2023, 07:03

Please be specific about the issue you encountered and where you think the documentation is inconsistent. Are you using v1 or v2? Are you sure your file is in a valid library folder? Show specifically what didn't work and where your library folder is located.

Hobby77
Posts: 30
Joined: 25 Jan 2021, 01:27

Re: A syntax error

Post by Hobby77 » 29 Mar 2023, 06:21

boiler wrote:
24 Mar 2023, 07:03
Please be specific about the issue you encountered and where you think the documentation is inconsistent. Are you using v1 or v2? Are you sure your file is in a valid library folder? Show specifically what didn't work and where your library folder is located.
This problem was found in v2, I placed files strictly according to this link

https://www.autohotkey.com/docs/v2/Scripts.htm#lib
https://www.autohotkey.com/docs/v2/lib/_Include.htm

It is recognizable when using the full path, not when using the file name. For example:
I put the file in [A_ScriptDir "Lib\mylib.ahk"]
and it doesn't work when I use:
#include mylib.ahk

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: A syntax error

Post by swagfag » 29 Mar 2023, 06:27

and nowhere does it claim it would. u should have written #include <mylib>

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: A syntax error  Topic is solved

Post by boiler » 29 Mar 2023, 06:31

That is not a bug. You are not using the correct syntax. If you want your script to find it in one of the library folders, you must follow what the documentation shows. Using the name you have given your file, then the line would be literally:

Code: Select all

#Include <mylib>
The above does not include any stand-in characters or anything. You put the name of your library file without the extension enclosed in angle brackets.

Moving topic from “Bug Reports” to “Ask for Help (v2)”.


Edit: Was typing my reply as swagfag posted.

Hobby77
Posts: 30
Joined: 25 Jan 2021, 01:27

Re: A syntax error

Post by Hobby77 » 29 Mar 2023, 06:41

boiler wrote:
29 Mar 2023, 06:31
That is not a bug. You are not using the correct syntax. If you want your script to find it in one of the library folders, you must follow what the documentation shows. Using the name you have given your file, then the line would be literally:

Code: Select all

#Include <mylib>
The above does not include any stand-in characters or anything. You put the name of your library file without the extension enclosed in angle brackets.

Moving topic from “Bug Reports” to “Ask for Help (v2)”.


Edit: Was typing my reply as swagfag posted.
I've tried not using the extension but it still doesn't work

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: A syntax error

Post by boiler » 29 Mar 2023, 06:42

Is that really the only change you made after reading the above two posts? From my post above:

The above does not include any stand-in characters or anything. You put the name of your library file without the extension enclosed in angle brackets.

Hobby77
Posts: 30
Joined: 25 Jan 2021, 01:27

Re: A syntax error

Post by Hobby77 » 29 Mar 2023, 06:54

boiler wrote:
29 Mar 2023, 06:42
Is that really the only change you made after reading the above two posts?
It works and I'm sorry for my sloppiness, thank you very much for your reply. This is my mistake, I put it in the wrong folder because I switched users so the user folder also changed

Post Reply

Return to “Ask for Help (v2)”