Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Prevent Resolution of Variable (http://forums.winamp.com/showthread.php?t=346554)

xbarns 23rd July 2012 09:40

Prevent Resolution of Variable
 
Hi all,

i am using

FileWrite $0 "LangString CheckDBName {LANG_ENGLISH} $\"Please check DB Name$\""

to create a set of translation files (comes out of a database we use for tracking translations).

In the file the string will look like this:

LangString CheckDBName 1033 "Please check DB Name"

is there a way to prevent the resolution of ${LANG_ENGLISH} to 1033 ?

Thanks a lot
xBarns

Anders 23rd July 2012 12:01

You mean define?

You can use this hack:
Quote:

!define dollar $
Foo ${dollar}{LANG_ENGLISH}

xbarns 23rd July 2012 12:06

That does the trick

Thanks a lot!

Yathosho 23rd July 2012 13:12

Quote:

Originally Posted by Anders (Post 2873334)
You can use this hack:

what's wrong with $${LANG_ENGLISH}?

xbarns 23rd July 2012 13:18

Quote:

Originally Posted by Yathosho (Post 2873338)
what's wrong with $${LANG_ENGLISH}?

I tried that first but it did not work :(

MSG 23rd July 2012 14:03

Only works to escape a variable, I think.

Yathosho 23rd July 2012 21:12

Quote:

Originally Posted by MSG (Post 2873348)
Only works to escape a variable, I think.

i'm pretty sure i got it working with a definition in a script of mine - otherwise my entire installer wouldn't work, but it does

MSG 24th July 2012 04:31

!define foo bar
detailprint "$${foo}"

Compiler: unknown variable/constant "bar" detected, ignoring (D:\Projects\MB\Installer\test.nsi:22)
Installer: $bar

detailprint "$$${foo}"
Compiler: no warnings
Installer: $bar

So no, doesn't work.

T.Slappy 24th July 2012 05:17

Quote:

Originally Posted by Anders (Post 2873334)
You mean define?

You can use this hack:

Heh, nice trick :)


All times are GMT. The time now is 17:43.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.