Allow comments to end with multiple * signs Topic is solved

Propose new features and changes
User avatar
A Keymaker
Posts: 457
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Allow comments to end with multiple * signs

15 Jun 2022, 12:21

Coming out from this discussion: viewtopic.php?f=60&t=105341

I would like to suggest making possible to mark end of comment part of a script by using multiple * signs; e.g.:

Code: Select all

*********************/
Currently a user can mark in a such visual way only the beginning of comment; i.e.:

Code: Select all

/*********************
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Allow comments to end with multiple * signs  Topic is solved

17 Jun 2022, 22:18

The documentation and version number imply a contract that guarantees scripts written now will not be unexpectedly broken by a minor update.

The "contract" set out in the documentation for v1 is:
In addition, the /* and */ symbols can be used to comment out an entire section, but only if the symbols appear at the beginning of a line (excluding whitespace), as in this example:

Code: Select all

/*
MsgBox, This line is commented out (disabled).
MsgBox, Common mistake: */ this does not end the comment.
MsgBox, This line is commented out. 
*/
Source: Scripting Language | AutoHotkey
A comment like

Code: Select all

/****
****/
This is a comment
*/
while unlikely, is perfectly legal in v1. Making the change you suggest would break this "contract", so would have to be accompanied by a change to the major version number (v1 -> v2).

But there's already a v2, and it already supports what you suggest.


Side note: The difference in interpretation of block comments can be used to create a file that contains v2 code that will be ignored by v1. This can be combined with other techniques to create a script that will re-launch itself using AutoHotkey v2 when the user runs it with AutoHotkey v1. AutoHotkey v2.0-beta.4 comes packaged with scripts that do this.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 28 guests