Multi Commander > Support and Feedback

StrReplace

(1/2) > >>

pncdaspropagandas:
In a MultiScript when I run

$python_script_path = StrReplace($python_script_path, '"', 'x');
it runs fine

but if I run
$python_script_path = StrReplace($python_script_path, '"', '^"');
it reports an error to Log Window

further, If I create a var with '^"' and use it like
$python_script_path = StrReplace($python_script_path, '"', $aux);
it runs fine also

I think there's something wrong there

Mathias (Author):
I have not check it yet
But I think you need to escape special character like "
 StrReplace($python_script_path, '"', "^\"");

And you need to use double quotes..  single quotes are used for paths where you do not want it to escape characters..

http://multicommander.com/docs/multiscript/languagesyntax#escseq

pncdaspropagandas:
I tried to use
$python_script_path = StrReplace($python_script_path, "\"", "^\"");

but the Log Window reports:
2017-02-02 16:55:30.623 Script engine error - Line : 18, Error : -1 => Code : "$python_script_path = StrReplace($python_script_path, "\"", "^\"")"

Mathias (Author):
But it worked if you defined it to a variable? Then probably the parser gets confused with all the "
You can try to encapsulated the constant string in parentheses since then they are evaluated first.
Or just use variables.


pncdaspropagandas:
Yes, it worked when I defined to a variable.
I'm using this way.

Thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version