An idea for improving the learning curve

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: An idea for improving the learning curve

16 May 2018, 15:45

this idea already exists and is called Go To Definition, in your editor of choice, that hopefully supports it
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: An idea for improving the learning curve

16 May 2018, 15:53

this idea already exists and is called Go To Definition
Good to know.
in your editor of choice
What are the choices please?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: An idea for improving the learning curve

16 May 2018, 16:11

https://autohotkey.com/boards/viewforum.php?f=60

in no particular order, to name a few: vim, notepad++, scite, ahk studio, sublime, atom, vs code

literally anything other than good ol notepad.exe will probably do
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: An idea for improving the learning curve

16 May 2018, 16:57

I tried to find, but I think I need more detailed instructions, how to get>install>use this feature.
It's better if we get someone who is already using this.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: An idea for improving the learning curve

17 May 2018, 12:27

https://github.com/ahkscript/SublimeAut ... ntegration

hell, u could even do it from within ahk itself

Code: Select all

; AHK_L 1.1.28.02+
#NoEnv
#WinActivateForce
#SingleInstance Force
#MaxThreadsPerHotkey 2
#Warn ClassOverwrite
SendMode Input
SetBatchLines -1
SetTitleMatchMode 2
SetWorkingDir %A_ScriptDir%

x::goToDefinition()
z::ExitApp

goToDefinition()
{
	clipSaved := Clipboard
	Send ^c
	Sleep 100

	if (WinExist("AutoHotkey ahk_exe hh.exe"))
		activateHelpPasteFast(100)
	else
		runHelpPasteSlow(100, 500)

	Clipboard := clipSaved
}

activateHelpPasteFast(delay)
{
	WinActivate
	Sleep delay
	Send !s
	Sleep delay
	Send ^a
	Sleep delay
	Send ^v
	Sleep delay
	Send {Enter}
}

runHelpPasteSlow(delay, delayBeforePaste)
{
	Run, % Format("*RunAs hh.exe {}\..\AutoHotkey.chm", A_AhkPath)
	Sleep delay
	Send !s
	Sleep delay
	Send ^a
	Sleep delayBeforePaste
	Send ^v
	Sleep delay
	Send {Enter}
}
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: An idea for improving the learning curve

17 May 2018, 14:25

@swagfag
Thanks. I tried the ahk code. It didn't work for me.
It does open the AutoHotkey Help (as administrator? why? I get the UAC each time), but it doesn't open the desired keyword. It always opens the default "HomePage".

Anyway,
swagfag wrote:this idea already exists and is called Go To Definition, in your editor of choice, that hopefully supports it
I think you are talking about the solution of opening the Documentation in the documentation pages itself. Similar to what I can do already in the white frame of the code above. *

While I'm talking about improving more than that:
Stamimail wrote:I think https://regex101.com/ is a good example to understand the concept of what I'm looking for.
You paste the code (in this case, you paste the regular expression), and then you can get the meaning of each part of the code by hovering the regular expression characters. Tooltips with relevant explanation are displayed.
Stamimail wrote:Instead of opening each link to its help, it will be more convenient to have a tooltip with short explantion (Wikipedia recently has this feature).
or
to make 2 panes/frames.
In one pane you paste the code, and in the other pane you can view the translation/explanation to each character/word according to the location where is the cursor moved with the arrows.
I think it will be either more convenient and will save more time.
____________
* That was what I meant by:
Stamimail wrote:Take the AHK forum for example.
When you paste a code into
a code display
you get links for some words to Help.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: An idea for improving the learning curve

17 May 2018, 15:14

Stamimail wrote:It does open the AutoHotkey Help (as administrator? why? I get the UAC each time), but it doesn't open the desired keyword. It always opens the default "HomePage".
remove *RunAs from

Code: Select all

Run, % Format("*RunAs hh.exe {}\..\AutoHotkey.chm", A_AhkPath)
and adjust the delay accordingly, UAC messes up the timing, which is why u see just the start page

as for the rest of it, i get what u mean now, but inline documentation seems like more of an IDE feature, i dont think you can reimplement it seamlessly via a script, maybe though
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: An idea for improving the learning curve

18 May 2018, 09:23

One more thing.
This HelpTool should also "translate" the meaning of syntax parts like:
^
+
{Esc}
::
:=
<>
!=
It seems you can't currently do it by the trick above.
How a beginner user can understand the meaning of those syntax parts?! There is no reference (links) to help for those syntax parts.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: An idea for improving the learning curve

18 May 2018, 10:48

I'd argue the point that a total beginner unfamiliar with programming in general shouldn't start off learning by parsing scripts token by token. That's what the tutorials are there for, but that's just me.

I could accommodate it to an extent in the script (lacking a full fledged parser, it will be at times inaccurate) though I find little value in having the IDE tell me a plus sign is a plus sign. With regex it might make more sense as they could get a bit cryptic, but built in language operators? It takes 15 min to go over the Operators man page, and that's as much as you're ever gonna need to spend on them.
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: An idea for improving the learning curve

21 May 2018, 07:26

1. I think it will improve the learning curve for the beginner.
2. It will be better to have "translation" to ^ + ... <> !=, but currently there is no references to ^ + ... <> != so the beginner can't even reach the relevant place in the help ("Sending Keystrokes", "Assignment Operators", "Expression Operators" ...)

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 11 guests