Re: 7zip basic script
Posted: 09 Jul 2013 01:18
Just some hints...
Instead of
perm $p_note = """C:\Documents and Settings\Administrator\My Documents\ConTEXT\ConTEXT.exe""";
you might write
perm $p_note = '"C:\Documents and Settings\Administrator\My Documents\ConTEXT\ConTEXT.exe"';
(as long as there's no variable in the string - it wouldn't be replaced)
Why
openwith "$p_ZipFM";
Quotes are to specify a string, and *allow* to include variables. But there is no string...
So you could write
openwith $p_ZipFM;
But if you want this statement *to add* quotes around the variable, it could be
openwith """$p_ZipFM""";
or
openwith '"'.$p_ZipFM.'"';
or
openwith quote($p_ZipFM);
// Please make sure that path to 7z.exe does not contain spaces
Why don't you just add quotes - than there might be spaces or not...
(For openwith you did that, but not for Run?)
(And for $p_note, but not for $p_zip + $pZipFM)
If you did it everywhere, you just could do it once when setting the variable, saving dozens of quotes...
Edit: above '" is a single and a double quote - sorry that it's hardly to recognize
Instead of
perm $p_note = """C:\Documents and Settings\Administrator\My Documents\ConTEXT\ConTEXT.exe""";
you might write
perm $p_note = '"C:\Documents and Settings\Administrator\My Documents\ConTEXT\ConTEXT.exe"';
(as long as there's no variable in the string - it wouldn't be replaced)
Why
openwith "$p_ZipFM";
Quotes are to specify a string, and *allow* to include variables. But there is no string...
So you could write
openwith $p_ZipFM;
But if you want this statement *to add* quotes around the variable, it could be
openwith """$p_ZipFM""";
or
openwith '"'.$p_ZipFM.'"';
or
openwith quote($p_ZipFM);
// Please make sure that path to 7z.exe does not contain spaces
(For openwith you did that, but not for Run?)
(And for $p_note, but not for $p_zip + $pZipFM)
If you did it everywhere, you just could do it once when setting the variable, saving dozens of quotes...
Edit: above '" is a single and a double quote - sorry that it's hardly to recognize