Re: Suggestions on documentation improvements
Posted: 22 Jul 2019, 14:56
ah, so they have been added/fixed. Thanks hopfully it'll be a bit more smooth to use now.
Let's help each other out
https://www.autohotkey.com/boards/
Well, sure, if you ignore the docs, yes... but since you are explicitly referencing the docs, you seem to be aware of their existence and contents.There is nothing "fully or clearly expressed" about a built-in function.
That example doesn't prescribe a certain outcome. But, afaics, some function named StrLen() will always be available, if you use an AHK version that corresponds to the docs version.And the call in the example to STRLEN, since IT COULD BE CALLED FROM A USER LIBRARY, is far from unequivocal.
For clarity, and consistency with `r flag.Replace `r`n with `n when reading and [standalone] `n with `r`n when writing.
Bump. Am I really wrong?autocart wrote: ↑26 Jun 2019, 04:38That's exactly why I asked. The thing here is that the length of bytes will change from 10 to 5, if you convert from UTF-16 to UTF-8. The length of characters would in normal western cases not change. I am wondering if there might be special exceptional cases with certain unusual letters? Or if the length of characters could change when converting to unusual code pages? (Normally, I'd think not, but of course I am now a bit uncertain.)
in the help still is confusing. "Conversion" can only refer to the "mapping" between the code-page applied to the string at address and the "ahk-intern" code-page. In this case, the length of chars will not change. It can only change if the applied code-page when reading differs from the applied/intended code-page when writing. However, this is not a "conversion" but rather a "reinterpretation" or a "brutal assignment of a wrong code-page".If conversion between code pages is necessary, the length of the return value may differ from the length of the source string.
If the code page used for StrGet does not correspond to the code page used when writing the string to address, then the returned string may differ from the original source string in both length and even characters.
It would be helpful if the documentation could clarify what AHK uses for:Line breaks generally act as a statement separator
It goes on to clarify some qualifications for 64-bit systems.The Program Files directory (e.g. C:\Program Files or C:\Program Files (x86)). This is usually the same as the ProgramFiles environment variable
Why? It works as advertised (yesterday is not in the right format in your example):jNizM wrote: ↑25 Sep 2019, 04:24Remove the TimeUnits Parameter from (Var -= Value [, TimeUnits] in EnvSub since this does not work
Ref: https://www.autohotkey.com/docs/commands/EnvSub.htm
Does not work:Code: Select all
yesterday := "" yesterday -= 1, days ; <- parameter #2 invalid. MsgBox % yesterday
https://www.autohotkey.com/docs/commands/EnvSub.htm#Parameters wrote:If present, this parameter directs the command to subtract Value from Var as though both of them are date-time stamps in the YYYYMMDDHH24MISS format.
Code: Select all
var1 := 20050126
var2 := 20040126
EnvSub, var1, %var2%, days
MsgBox, %var1% ; The answer will be 366 since 2004 is a leap year.
Why would you delete it?https://www.autohotkey.com/docs/commands/EnvSub.htm wrote:Synonymous with: Var -= Value.
Code: Select all
var1 := 20050126
var2 := 20040126
var1 -= var2, days
MsgBox, %var1% ; The answer will be 366 since 2004 is a leap year.
var1 := 20050126
var2 := 20040126
EnvSub, var1, %var2%, days
MsgBox, %var1% ; The answer will be 366 since 2004 is a leap year.
https://www.autohotkey.com/docs/commands/EnvSub.htm#Parameters wrote:If present, this parameter directs the command to subtract Value from Var as though both of them are date-time stamps in the YYYYMMDDHH24MISS format.