# Unable to log variables with expansion disabled

**URL:** https://www.finalbuilder.com/forums/t/unable-to-log-variables-with-expansion-disabled/1591
**Category:** Discussion
**Created:** [September 9, 2010, 11:14am UTC](https://www.finalbuilder.com/forums/t/unable-to-log-variables-with-expansion-disabled/1591 "2010-09-09T11:14:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 9, 2010, 11:14am UTC](https://www.finalbuilder.com/forums/t/unable-to-log-variables-with-expansion-disabled/1591/1 "2010-09-09T11:14:46Z")

</div>

Using FB 7.0.0.515

I have a variable DLibPath that contains the Delphi Library Seach path. This contains text like "$(BDS)\Lib" etc.

If I select this variable in an action such as "Log variable values" then I get an error like "Unable to expand variable". This could be avoided by placing an "!" in front of the variable name, but I can only select the variables from a list.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 9, 2010, 11:59am UTC](https://www.finalbuilder.com/forums/t/unable-to-log-variables-with-expansion-disabled/1591/2 "2010-09-09T11:59:52Z")

</div>

This is because $(BDS) is only defined for the Delphi & C++Builder actions, it’s not available outside of those actions.

---

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 9, 2010, 12:58pm UTC](https://www.finalbuilder.com/forums/t/unable-to-log-variables-with-expansion-disabled/1591/3 "2010-09-09T12:58:34Z")

</div>

I am aware of that. My point was that there is no way of logging the variable (or including it in the “Save variable to ini” action) without first parsing it manually and escaping any characters in there.   
 In other words you cannot load the contents of a file into a variable and then log that variable without risking the runtime error, because the file might contain $ or % characters that would lead FB to try to expand it.   
 So in script I can do something like Action.SendLogMessage(MYVAR) with a variable containing the special characters but I cannot do the same with the “Log variable values” action.   
  
 Not a big issue, but just something I ran into 🙂
