Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


CtrlAltDel
2010-03-26T00:14:06Z
On my server I have multiple Windows services to manage; they are all installed into the same root folder, into their own service-specific folders, and within those folders, into version specific folders. This gives a structure like this:

D:\Services\
     Application1\
          v1\
          v2\
     Application2\
          v1\
          v2\


I've defined a user variable ServiceBasePath as D:\Services\. I then define a user variable Application1Path as being {PATH(Combine|{USERVAR(ServiceBasePath)}|Application1)}, and the preview shows that it resolves correctly as D:\Services\Application1. I then define a user variable Version as v1, which is also fine.

However, when I then try to create another user variable by combining Application1Path and Version, setting it as {PATH(Combine|{USERVAR(Application1Path)}|{USERVAR(Version)})}, the preview shows nothing, and when I write the value of the variable to a file, also get nothing.

So, how do I do a PATH-Combine on two user variables? Or am I approaching this from the wrong direction?
Sponsor
Forum information
ErikC
2010-03-26T07:48:51Z
What if you set the Application1Path to a constant variable?

5.5.0 [FEATURE] Client/Server: Added option to Set Variable Task: Translate to constant Variable

If you use uservariables within uservariables the parsing might go wrong.

Regards

Uses Visualcron since 2006.
CtrlAltDel
2010-03-28T23:46:51Z
ErikC wrote:

What if you set the Application1Path to a constant variable?

5.5.0 [FEATURE] Client/Server: Added option to Set Variable Task: Translate to constant Variable

If you use uservariables within uservariables the parsing might go wrong.

Regards



What's the syntax for using a static variable (sounds better than a constant variable!)?

Also, when I release v3, for example, and set the Version user variable to a new value, how do I get VC to calculate the new path?
ErikC
2010-03-29T08:51:18Z
To translate a variable to a constant (static for you 😎) use the checkbox 'Translate to constant when running' in the 'Set Variable' task.

Try not to go deeper than 1 level with variables. It is harder to understand what the variable contains and as I said, parsing can go wrong with multiple levels.
Uses Visualcron since 2006.
Scroll to Top