You are here: PSPad forum > English discussion forum > Code Explorer for AutoHotkey not working
Posted by: jballi | Date: 2019-04-01 11:35 | IP: IP Logged
I'm a long time user of PSPad but I'm very slow to update. I've just updated to v5.01 from v4.60.
The Code Explorer for AutoHotkey (*.ahk) does not appear to be working at all the new version. It appears to recognize calls to DllCall functions within the code but it doesn't recognize anything else. No labels, functions, classes, etc.
I hope I'm just doing something wrong but I don't know it could be.
Any help would be appreciated.
Posted by: pspad | Date: 2019-04-01 11:48 | IP: IP Logged
Send me come code samples to support mail with description what should appear in Code explorer
Posted by: jballi | Date: 2019-04-01 12:07 | IP: IP Logged
I'm a little surprised at the response since Code Explorer has supported AutoHotkey for many many years (since 2007 I think) but here goes.
Here is a small code sample:
#NoEnv
#SingleInstance Force
gui Margin,50,50
gui Add,Button,gButton1,Press Me
gui Show
return
GUIEscape:
GUIClose:
ExitApp
Button1:
x1:=MyFunc1(22)
x2:=MyFunc2(22)
MsgBox %x1%, %x2%
return
MyFunc1(p1)
{
Return p1+1
}
MyFunc2(p1)
{
Return p1+2
}
In the Code Explorer window, there should be references to the GUIEscape, GUIClose, Button1 labels and to the MyFunc1 and MyFunc2 functions. This sample does not include a class but according to the PSPad History page, "Code explorer for Autohotkey - class support added".
Thank you for your assistance.
Posted by: pspad | Date: 2019-04-01 12:29 | IP: IP Logged
I don't know whats happened. I didn't make any changes intentionally.
Request for code sample will speed up my work when I will look for problem source.
Posted by: kabuman | Date: 2019-11-01 16:51 | IP: IP Logged
Hello
I'm facing the same issue with version 5.0.1. I have re-installed an older version
4.6.2. The code explorer works fine in this old version.
Please let me know if you need further examples.
Best Regards
kabuman
Posted by: pspad | Date: 2019-11-01 17:23 | IP: IP Logged
kabuman:HelloI'm facing the same issue with version 5.0.1. I have re-installed an older version
4.6.2. The code explorer works fine in this old version.Please let me know if you need further examples.
Best Regards
kabuman
1. download the current developer build 5.0.2 and replace PSpad.exe
2. ensure user highlighter for Autohotkey has file type ftAHK assigned
Posted by: kabuman | Date: 2019-11-02 22:11 | IP: IP Logged
Hello
Perfect. It works. The Code Explorer detects the correct Autohotkey functions.
Many thanks for you fix. Have a nice weekend.
Best Regards
kabuman
Posted by: kabuman | Date: 2019-11-03 08:11 | IP: IP Logged
I looked a little bit more in detail and it seems that the Code Explorer does not differentiate between a function definition and a function call.
For instance:
1: fct_A()
2:
3: fct_A(){
4: }
Line 1 calls the function. Line 3 is the function definition.
The Code Explorer contains two references: line 1 and line 3.
But I expect the reference to line 3 only.
Sometimes call references (line 1) are helpful. But in ahk files with a lot of functions it is not really useful.
Please can you have a look? Many thanks in advance.
Or can I make own definition and rules for the Code Explorer?
Best Regards
kabuman
Posted by: pspad | Date: 2019-11-03 11:24 | IP: IP Logged
kabuman:I looked a little bit more in detail and it seems that the Code Explorer does not differentiate between a function definition and a function call.For instance:
1: fct_A()
2:
3: fct_A(){
4: }Line 1 calls the function. Line 3 is the function definition.
The Code Explorer contains two references: line 1 and line 3.
But I expect the reference to line 3 only.Sometimes call references (line 1) are helpful. But in ahk files with a lot of functions it is not really useful.
Please can you have a look? Many thanks in advance.
Or can I make own definition and rules for the Code Explorer?Best Regards
kabuman
Can you provide me more complex example? I can modify code explorer as needed, but I don't know Autohokey syntax.
Can be function definition as:
fct_A()
{
...
}
Or "{" must be on the same line as function name?
Posted by: kabuman | Date: 2019-11-05 10:06 | IP: IP Logged
Both of them is valid:
fct(){
...
}
or
fct()
{
}
But the following "{" is required. Otherwise it is only a function call
Another example for that:
fctA() ; is a function call only. Please do not shown in Code Explorer
fctA(){ ; Definiton of function A: this should appear in the Code Explorer
...
} ; end of function A
fctB() ; Definition of function B: this should appear in the Code Explorer
{
...
fctA() ; but this not because it is a function call only
...
} ; end of definition for function B
function definition within another function are not valid.
So functions are never nested.
Please let me know if you need further information...
Many thanks.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR