PerditionC
21st January 2003 17:14 UTC
can LangString text be combined without an intermediate step
Below is a sample. If I first copy the
LangString message to $0 then I can use
it with other text "$0", "abc$0", and
"$0abc" but $(message) itself can not be combined. Am I doing something wrong or is this simply not an option? Admittedly its easy to get around but makes the code less clear. Also you may want to emphasis in the docs to use parenthesis () and not curly braces {} as I didn't notice this until careful looking (the font my browser displayed the docs in makes it hard to see any difference). :-)
Thanks,
Jeremy
[edit by kichik]see script below (please attach large scripts)[/edit]
virtlink
21st January 2003 18:35 UTC
Your code isn't very long, but you should post it as an attachment. if you have a few lines of code, you can highlight the code by using [ php ] [ /php ] around the code. Without the spaces before and after 'php'.
virtlink
21st January 2003 18:53 UTC
I tried to find the error, but couldn't. By the way, the documentation doesn't say anything about when to use ${symbol} and when $(symbol). Sometimes it even generates a couple of errors more:
warning: unknown variable "{Message}" detected, ignoring
warning: unknown variable "{Message)" detected, ignoring
warning: unknown variable "(Message)" detected, ignoring
:eek: :eek: :eek:
PerditionC
21st January 2003 19:23 UTC
(Sorry about not attaching)
Well for me, each section
prints a message, with all 5 I get:
English message
hi$(Message) & a warning during compile
hiEnglish message
English message
English messagehi
the desired output is:
English message
hiEnglish message
hiEnglish message
English message
English messagehi
English messagehi
As best I can tell, you use curly braces ${} for all defines, parenthesis $() for all LangStrings, and $val for predefined registers. Any other use I've tried results in the unknown variable warning.
With $val and ${} I can combine with literal text without the need for an explicit StrCpy, but when using $() I have to use a StrCpy and a temp variable. That is one must StrCpy $0 $(message) and then StrCpy "pre-text$0 post-text", and if one has another LangString to add, StrCpy $1 $(another_message) then StrCpy $0 "$0$1"
because even StrCpy $0 "$0$(another_message)" will fail ...
Note: I am using NSIS 2.0b0 if it makes a difference.
kichik
21st January 2003 19:30 UTC
LangStrings can you only be used on their own. You can't include them in other strings. "look at my $(string)! isn't it beautiful?" will be seen exactly as written, $(string) will not be expended.
I have added this a few days ago to the docs.
I will make a note about the different braces.
kichik
21st January 2003 19:31 UTC
=/
A little typo there with the expansion, I will fix that too :)
PerditionC
21st January 2003 19:34 UTC
Ok, I was just making sure I wasn't overlooking something. The above doc update definitely answers my question.
Thank you.