# Passing variables to included script

**URL:** https://www.finalbuilder.com/forums/t/passing-variables-to-included-script/4264
**Category:** Discussion
**Created:** [February 16, 2007, 11:22am UTC](https://www.finalbuilder.com/forums/t/passing-variables-to-included-script/4264 "2007-02-16T11:22:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [February 16, 2007, 11:22am UTC](https://www.finalbuilder.com/forums/t/passing-variables-to-included-script/4264/1 "2007-02-16T11:22:34Z")

</div>

What are the exact settings I need to apply to variables for them to be accepted into an included script?  
  
Right now I’ve got a list iterator which updates a temporary variables \_Foo and for each iteration a call is made to an external build file, setting the variable Foo=%\_Foo%. The variable doesn’t catch however and the default value in the included project is always used. The log shows that Foo is set to the correct value upon calling the included script, but the expansion is wrong.  
  
Variables are not shared and I’ve tried making variables macros (reevaluate on each reference) and not, but it doesn’t work. If I pass the variable on the commandline to the included script it works just fine, apart from not passing variables to the environment when running external commands, even if they are marked as such.  
  
What am I doing wrong?

---

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [February 16, 2007, 11:29am UTC](https://www.finalbuilder.com/forums/t/passing-variables-to-included-script/4264/2 "2007-02-16T11:29:57Z")

</div>

Apparently, logging all the variables once, improves things slightly, but not all the way. Here’s an example output. Everywhere it says “Debug”, it should have said “Release”, since that’s what I pass to the script. The project variable BuildConfig defaults to Debug.  
  
C:\Work\ws\betstone-main-axl\Code\>fbcmd /tl /p…\Common\Bin\DeployDebugSymbols.fbp5 /vBuildConfig=Release /b  
  
Variable [BuildConfig] set to [Release]  
  
Project File: C:\Work\ws\betstone-main-axl\Common\Bin\DeployDebugSymbols.fbp5  
  
Build Started: 2007-02-16 11:33:07  
  
  
&nbsp; [Start ActionList: Main]  
  
&nbsp; [Log Variable Values]  
&nbsp; Current variable values :  
&nbsp; BuildConfig = Debug  
&nbsp; ProductName = Not set  
&nbsp; ProductVersion = 1.0.0.0  
&nbsp; SRCSRV\_SOURCE = C:\Work\ws\betstone-main-axl\Code  
&nbsp; SRCSRV\_SYMBOLS = C:\Work\ws\betstone-main-axl\Local\Bin\Debug  
&nbsp; SRCSRV\_SYSTEM = p4  
&nbsp; SYMBOLSERVER = \Halo\Symbols  
&nbsp; SYMSTORE\_COMMENT =  
&nbsp; SYMSTORE\_DIR = C:\Work\ws\betstone-main-axl\Local\Bin\Debug  
&nbsp; SYMSTORE\_FILES = _._  
&nbsp; SYMSTORE\_LOGFILE = C:\Work\ws\betstone-main-axl\symstore.log  
&nbsp; SYMSTORE\_PRODUCT = Not set  
&nbsp; SYMSTORE\_STORE = \Halo\Symbols  
&nbsp; SYMSTORE\_VERSION = 1.0.0.0

---

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [February 16, 2007, 3:50am UTC](https://www.finalbuilder.com/forums/t/passing-variables-to-included-script/4264/3 "2007-02-16T03:50:42Z")

</div>

Conclusion: If a variable is set to reevaluate itself on each reference (macro), the default value will be reassigned on first use even if another value has been given as a parameter.  
  
/axl - Almost weekend
