If you don't disable variable expansion - SetOption('NoVarsInStrings', 'on') - you need to "escape" the $ by doubling it. Same with macros and the @.

With variable expansion, Kix has to peek inside every string, look for "$" chars, and try to figure out if what follows it is a variable, and replace the variable with its value. When you want a "$", you use "$$", which tells Kix "no - really put a $ here!"

When you disable variable expansion, you basically are saying "I promise not to put variables inside of quoted strings, so - Kix - take it easy and just output the strings without any extra effort!" Yes, this requires extra effort on our part to build the text strings properly, but it avoids many other issues with data manipulation.

Imagine "The price is $$$Price" vs "The price is $" + $Price - where do you think more problems will occur? ;\)

Glenn

PS - take a look at the Sanity UDF. It calls out undeclared vars, duplicate declarations, finds mismatched quotes, parens, and even insures that paired commands (like If/EndIf) are properly matched up. KGen uses Sanity as a final step in assembling scripts, so it's a quick way to validate even simple scripts that don't use UDFs.
_________________________
Actually I am a Rocket Scientist! \:D