- @coffee: Some history, in case it explains any of how the source code is laid out:
AHK v1.0 had Loop Count/Files (old style)/Parse/Read/Reg (old style) and while.
AHK v1.1 introduced Loop Files (new style)/Loop Reg (new style) and for.
- So, what is your conclusion re. whether you have 1 Loop CFS (control flow statement) with 5 'subcommands' or 5 LoopXXX CFSs, does it really make a difference performance-wise?
- One reason why I'd prefer LoopXXX, is that you can see at a glance that's it's a loop.
- Cf. all the FileXXX functions, and a proposed 'FileLoop', blurring into each other.
- Also, for/loop/while are words that are well understood, and it makes sense to have these words at the front of the CFS names.
- To whoever suggested 'StrSplitLoop', I can't argue against that on purely logical grounds, but I can argue against that on aesthetic grounds.
Code: Select all
LoopParse vText, "`n", "`r" ;the most consistent with AHK v2 functions
LoopParse, vText, "`n", "`r" ;the most elegant
Loop "Parse", vText, "`n", "`r" ;also consistent with AHK v2 functions (but wrong, and users will make this mistake, and it takes a paragraph or two to explain)
Loop Parse vText, "`n", "`r" ;confusing: comma or no comma
Loop Parse, vText, "`n", "`r" ;confusing: comma or no comma
LoopParse(vText, "`n", "`r") ;of the function possibilities, best of the bunch
Loop("Parse", vText, "`n", "`r") ;unsettling
Loop(Parse, vText, "`n", "`r") ;even more unsettling than 'Loop("Parse", ...', a strong argument against 'Loop Parse'
;in use:
LoopParse vText, "`n", "`r"
{
vTemp := A_LoopField
}
;if we bring back initial commas (very nice, I wish AHK v2 could look this nice, very satisfying to look at):
LoopParse, vText, "`n", "`r"
{
vTemp := A_LoopField
}
Code: Select all
;inconsistent: 'param 1' is either a variable or a 'subcommand'
Loop var
Loop Files var
Loop Reg var
Loop Parse var
Loop Read var
;a solution:
Loop var
LoopFiles var
LoopReg var
LoopParse var
LoopRead var
;an alternative (undesirable) solution:
Loop Count var
Loop Files var
Loop Reg var
Loop Parse var
Loop Read var
- Of 'Loop XXX'. Is that a two-word entity, or a one-word entity with 'subcommands'?
- There aren't any other two-word entities (i.e. command/function/directive/CFS names) in AutoHotkey, why should Loop be special?