<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Variable load order of CSB variables and cfg files</title><link>https://communities.bentley.com/products/projectwise/f/projectwise-di-forum/239955/variable-load-order-of-csb-variables-and-cfg-files</link><description>I would like some clarification on setting variables in CSB and cfg in the CONNECT Edition WorkSpace/WorkSet configuration in ProjectWise. 
 The load order of Managed CSBs are: 
 1. Predefined 
 2. Global 
 3. etc... 
 At any point in the CSB a cfg file</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Variable load order of CSB variables and cfg files</title><link>https://communities.bentley.com/thread/747454?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 21:17:18 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:771730c9-10e3-44cb-88e7-807f6bc45350</guid><dc:creator>Kevin van Haaren</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;The _USTN_WORKSPACESROOT variable is populated in the WorkSpace Managed CSB which is loaded after the Predefined CSB and then the WorkSpaceSetup.cfg?&lt;/p&gt;
&lt;p&gt;If everything is loaded in order, the WorkSpaceSetup.cfg won&amp;#39;t know the value of _USTN_WORKSPACESROOT because it won&amp;#39;t load until the WorkSpace Managed CSB is loaded?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Kind of. There are 2 ways to refer to the value of a variable: in parenthesis $(VARIABLE_NAME) and braces ${VARIABLE_NAME}. When parenthesis are used microstation retains the $(VARIABLE) structure and doesn&amp;#39;t substitute the value in place until the variable referring to it is used. So as the config files are loaded and microstation has:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;_USTN_WORKSPACESROOT : $(_USTN_CONFIGURATION)WorkSpaces/
_USTN_WORKSPACEROOT  : $(_USTN_WORKSPACESROOT)$(_USTN_WORKSPACENAME)/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;ll remember that _USTN_WORKSPACEROOT is $(_USTN_WORKSPACESROOT) and $(_USTN_WORKSPACENAME) but even though _USTN_WORKSPACENAME isn&amp;#39;t set yet it keeps processing. Then when MicroStation finally goes to load it looks at the _USTN_WORKSPACEROOT variable and now _USTN_WORKSPACENAME IS defined so it substitutes it in and the variable points to the correct location.&lt;/p&gt;
&lt;p&gt;So by using $(VARIABLE_NAME) MicroStation will re-evaluate the variable everytime it&amp;#39;s used and use the current values of whatever variables are used in the definition.&lt;/p&gt;
&lt;p&gt;(Braces, by the way, mean &amp;#39;do the substitution right now, and don&amp;#39;t remember the source&amp;#39; so _USTN_WORKSPACEROOT = ${_USTN_WORKSPACESROOT}${_USTN_WORKSPACENAME}/ would fail the way you mention)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>