Archive: new warning in NSIS 2.24 (comments multi-line)


new warning in NSIS 2.24 (comments multi-line)
warning: comment contains line-continuation character, following line will be ignored

This occurs when in code there is something like this:

; bla \
; blub

I think this warning should only occur when the next line does not begin with a comment char (obviously the such lines could be created by some editor -- inserting a comment char before each line of the block).


you cant end a line with backslash
write "backslash" instead

i noticed this last year first time and got really confused.

it is also not possible to write
FileWrite $0 "$${NSISDIR}"

it always is messed up like "$c:\programs\..." instead "${NSISDIR}"

i wrote a function combining FileWrite and FileWriteByte to get the correct result.

thats a bit annoying...


you cant end a line with backslash
write "backslash" instead
or escape it: \\

i noticed this last year first time and got really confused.
why. its documented behaviour. nsis is a line-by-line script language that does not ignore white-spaces like c/c++/... does. so obviously theres a need for a line-continuation character.

it is also not possible to write
FileWrite $0 "$${NSISDIR}"
yes, thats a point. but this is because of NSIS' preprocessor, and it would behave the same on every other preprocessor on every other language/platform.

use:
FileWrite $0 "$${NSIS"
FileWrite $0 "DIR}"

or:
StrCpy $1 "$$"
StrCpy $1 "$1{NSISDIR}"

as a workaround.

or escape it: \\
didn't worked here either...

@solutions *gg*

Re: new warning in NSIS 2.24 (comments multi-line)

Originally posted by stb
warning: comment contains line-continuation character, following line will be ignored

This occurs when in code there is something like this:

; bla \
; blub

I think this warning should only occur when the next line does not begin with a comment char (obviously the such lines could be created by some editor -- inserting a comment char before each line of the block).
Currently, the test for this warning is done on the actual line where the backslash is located. It would be nicer to display this warning only when the backslash affects something. Submit a feature request or a patch for it.

I do not want to end a line with a backslash. This is about "escaping" line breaks not about escaping back slashes. The backslash was intended!

That was one statement which was broken into two lines (using backslash). I commented this out by inserting semicolon before each line (I think this is a feature of many editors).

This causes warnings. The warning says that the second line will be a comment because of the backslash. This is true. The second line would be a comment anyway because it begins with a semicolon, too. So the warning should only occur when the following line would be no comment when the backslash was removed.


Feature request

http://sourceforge.net/tracker/index...49&atid=373088