Page 1 of 1

Macros: # doesn't work inside strings

Posted: Fri Nov 10, 2006 3:20 pm
by Trond

Code: Select all

Macro LocalizedFile(Name)
  "File#Name"
EndMacro
LocalizedFile(Test)

Posted: Fri Nov 10, 2006 3:30 pm
by freak
Nothing inside a literal string is replaced. This is the intended behaviour.
Putting only "Name" inside will not have it replaced either.

There are a number of ways to get this done. Like this one:

Code: Select all

Macro _QUOTE
"
EndMacro

Macro _STRING(s)
_QUOTE#s#_QUOTE
EndMacro

Macro LocalizedFile(Name)
  _STRING(File#Name)
EndMacro
LocalizedFile(Test)

Posted: Fri Nov 10, 2006 3:41 pm
by Trond
Thank you, I didn't think it was possible to do it.