indentation systems
Posted: 13 Nov 2017, 15:17
I'm looking to collect information about any indentation systems used with AutoHotkey, that are either in some way standard, or commonly used.
I have absolutely no desire to add to my automatic indentation function, but it's possible at some point that I'll add to it.
indent code (automated code indentation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=37270
Btw the following code is not guaranteed to be a/the standard style, we're just asking the questions.
Is this the most standard style?
Making things a little more complicated, is this standard?
Some indentation examples:
detect/Remove duplicate values in array - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 14#p182214
Anagrams - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 19&t=34240
One of the key rules re. building an algorithm is 'what's allowed in column 1'.
So far I've seen: labels (function/hotkey/subroutines), curly braces, and return/Exit/ExitApp.
They may not look so similar, but here is the equivalence between subroutines and functions. Crucially, subroutines need a return line to mark their end, a return line that would be unnecessary in a function.
Thanks for reading. Please comment.
Links:
Need your opinion with "Indentation" - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=21958
I have absolutely no desire to add to my automatic indentation function, but it's possible at some point that I'll add to it.
indent code (automated code indentation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=37270
Btw the following code is not guaranteed to be a/the standard style, we're just asking the questions.
Is this the most standard style?
Code: Select all
MsgBox ;(indent the auto-execute section?)
return
q::
; comment ;(I prefer no space after the semicolon)
MsgBox
if (a = b)
MsgBox
if (a = b)
{
MsgBox
MsgBox
}
t := "
(LTrim
text
)"
return
f()
{
MsgBox
}
Code: Select all
f()
{
MsgBox ;(should one tab be removed here?)
L1:
MsgBox
L2:
MsgBox
return
L3:
MsgBox
}
detect/Remove duplicate values in array - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 14#p182214
Anagrams - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 19&t=34240
One of the key rules re. building an algorithm is 'what's allowed in column 1'.
So far I've seen: labels (function/hotkey/subroutines), curly braces, and return/Exit/ExitApp.
They may not look so similar, but here is the equivalence between subroutines and functions. Crucially, subroutines need a return line to mark their end, a return line that would be unnecessary in a function.
Code: Select all
;to demonstrate equivalence:
q::
MsgBox
return
f() {
MsgBox
} ;return
;in normal use:
q::
MsgBox
return
f()
{
MsgBox
}
Links:
Need your opinion with "Indentation" - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=21958