Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Suggestions on documentation improvements


  • Please log in to reply
244 replies to this topic
AEN007
  • Members
  • 136 posts
  • Last active: Feb 07 2012 05:24 PM
  • Joined: 04 Apr 2009
26June2012

<!>^whatever::
on a laptop without an AltGr key is just as convoluted as
<^>!whatever::
on a laptop with an AltGr key ...

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
AEN007, did you have a suggestion for a documentation improvement (note the thread title)??

I can not (so far) execute <^>! "hotkeys" via an AHK script;

AutoHotkey_L:
SendLevel 1
Send {LCtrl down}{RAlt down}+#a{RAlt up}{LCtrl up}
<^>!+#a::MsgBox
SendLevel is required to trigger any hotkey implemented by the keyboard hook. See ListHotkeys.

AEN007
  • Members
  • 136 posts
  • Last active: Feb 07 2012 05:24 PM
  • Joined: 04 Apr 2009
27June2012

I have tried to bring the issue to the attention of the those who write/publish the documentation.
They can choose to try to document the issue (and how to if so) or not ...
I do not use AHK_L ... still not yet anyway ...

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
The behaviour you described in your first paragraph sounds completely normal to me, and I don't see why you "tweaked" your script the way you did. The other "shortcoming" you mentioned has nothing to do with AltGr (or <^>!) but hook hotkeys, which the documentation already indicates cannot be triggered by Send.

So basically, I don't see what it is you expect to be documented.

AEN007
  • Members
  • 136 posts
  • Last active: Feb 07 2012 05:24 PM
  • Joined: 04 Apr 2009
27June2012

... I don't see why you "tweaked" your script the way you did.

Then, it seems to me, that you are missing the point ... or claiming to ... it doesn't matter to me either way ...

So basically, I don't see what it is you expect to be documented.

Forget it ...
what do I care if using <!>^whatever:: or <^>!whatever:: hotkeys to launch scripts
makes the same problems for others that they made for me ...

thanks for the technical tips, however ...

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Then, it seems to me, that you are missing the point

Yes, that's more or less what I said.

hoppfrosch
  • Members
  • 399 posts
  • Last active: Feb 26 2016 05:31 AM
  • Joined: 25 Jan 2006
@Lexikos:

Where are the sources for current AHK-Documentation?
I thought it should be github - but documentation on github differs from current documentation (1.1.08)

Steps I took:
* Cloning documentation from https://github.com/L...tkey_L-Docs.git and switching to branch master (which seems to to be more recent as gh_pages)
* Compiling provided "Project.hpp" with HTMLHelp Workshop leads to a different CHM as provided with current AHK
For example:: locally compiled CHM contains an own page for "WinExist" - whereas current AHK-documentation does not have this page ....

Could you please provide a place, where the current documentation sources are available?

TIA

Hoppfrosch

P.S. Branch gh_pages on github is completly out of date

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
It's on github, under the master branch. The default branch is gh-pages, which is the v2 documentation. The v2 documentation isn't complete, let alone up to date.

https://github.com/L...ocs/tree/master

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
StrPut() / StrGet()

StrPut returns the number of characters written, the required buffer size in characters if no Address was given, or 0 if an error occurred.

It should be mentioned that it is returning the required buffer size in bytes for UTF-8, not characters.

Prefer ahkscript.org for the time being.


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
It refers to "characters" in the encoding being written, not in the source encoding. For practical reasons, a "character" is an 8-bit or (for UTF-16) 16-bit unit, not necessarily a complete Unicode character. The same goes for all the string functions.

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
It may be practical, but it is confusing though. Nobody would really say, that 40 • (0x95) will need a buffer of 120 characters when encoded as UTF-8 in a unicode build. (MS may have named the function MultiByteToWideChar() for a reason.)

The only use of the return value is to set the capacity of the receiving variable by a call of VarSetCapacity() passing the requested capacity in bytes. So I think it would be more useful, if StrPut() would always return the needed buffer size in bytes, but the change would most likely break existing scripts.

Prefer ahkscript.org for the time being.


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Nobody would really say, that 40 • (0x95) will need a buffer of 120 characters when encoded as UTF-8 in a unicode build.

Your figures are ridiculous (edit: ignore this; I had misread the post). Aside from that,

cchWideChar: Size, in characters, of the buffer



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

Your figures are ridiculous.

I had to look on leo.org for that. Isn't really nice, or is it?

Aside from that,

cchWideChar: Size, in characters, of the buffer

Well, but that's the UTF-16 buffer which (as you know) has a fixed character size.

cbMultiByte: Size, in bytes, of the string indicated by the lpMultiByteStr parameter.


Prefer ahkscript.org for the time being.


fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
Here's an example for a custom enumerator which could be included in the help file. It will simply enumerate from 1 to Object.MaxIndex() (even if those keys don't exist).
/*

Class: CEnumerator

Generic enumerator object that can be used for iterating over numeric keys.

The array must not be modified during iteration, otherwise the iterated range will be invalid.

It's possible to define a custom MaxIndex() functions for array boundaries.

If there are missing array members between 1 and max index, they will be iterated but will have a value of "".

This means that real sparse arrays are not supported by this enumerator by design.

To make an object use this iterator, insert this function in the class definition:

|_NewEnum()

|{

|	return new CEnumerator(this)

|}

*/

Class CEnumerator

{

	__New(Object)

	{

		this.Object := Object

		this.first := true

		;Cache for speed. Useful if custom MaxIndex() functions have crappy performance.

		;In return that means that no key-value pairs may be inserted during iteration or the range will become invalid.

		this.ObjMaxIndex := Object.MaxIndex()

	}

	Next(byref key, byref value)

	{

		if(this.first)

		{

			this.Remove("first")

			key := 1

		}

		else

			key++

		if(key <= this.ObjMaxIndex)

			value := this.Object[key]

		else

			key := ""

		return key != ""

	}

}


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
just me: UTF-16 characters are not fixed size.

It had come to my attention that some users are confusing the purpose of StrPut with StrGet, so I already had it in mind to revise the documentation. When I do this, if I can also clarify the return value without going into great length, I will do so.

fragman: Thanks.