Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherHey,
Using the {{^^}} textual substitution mechanism for parameters substitutes the text
directly into where it is referenced - without doing any other operations (no quoting, no esaping, just direct textual substitution).
Therefore if you have:
SourePath = D:\Lavastorm\Workspace\Iinput\
And you use:
This produces invalid brainscript:
path = D:\Lavastorm\Workspace\Iinput\
What you want is probably to have this quoted and escaped (as the '\' character denotes an escape sequence):
path = "D:\\Lavastorm\\Workspace\\Iinput\\"
Or:
path = "D:/Lavastorm/Workspace/Iinput/"
In order to do this, you can either set your SourcePath parameter to something like:
SourePath = "D:\\Lavastorm\\Workspace\\Iinput\\"
or change the '\' characters to '/' characters in the SourcePath and change your path reference to:
path = "{{^SourcePath^}}"
There is another alternative which is to assign a runtime property name to the SourcePath parameter.
However, the runtime property would need to be defined on the node itself.
To do this, in the node editor, you would declare a parameter "SourcePath" via the "Declare Parameters" dialog.
Then, set the Runtime Property Name to some value (e.g. node.sourcePath or something).
Then within your script you are able to reference this using:
path = property("node.sourcePath")
When using the property accessor, this is evaluating a property and you are able to assign it to a variable.
Using this mechanism, since it isn't directly inserting text into the script you don't need to worry about escaping or quoting.
Regards,
Tim.