Page 4 of 4
Posted: 27 Apr 2008 21:14
by admin
Twisten wrote: 
or if calling a script command using variables like so:
command $1, $2 ,$3;
will be treated differently by xyplorer so it wouldn't need the parameters quoted even if for example the variable $2 contained some ,;" chars?
A variable can contain anything without posing a problem. It's only literal strings that have to be quoted when containing separators. That's pretty standard in scripting languages AFAIK.
Please, give an example of a statement that troubles you.
Posted: 28 Apr 2008 00:55
by Twisten
well i'll try and give a simple example (its very late):
if i recall correctly this case gives a problem
RegExReplace $r, $s, "["`'](?=\d+)", " ";
are you saying that this will work fine, where $p=["`'](?=\d+):
RegExReplace $r, $s, $p, " ";
still i wasn't thinking that clearly with that idea since:
set $p, ["`'](?=\d+);
is subject to the same parsing, its seems the only way to make it work is to turn
["`'](?=\d+)
to
"[""`'](?=\d+)"
which feels just plain wrong to read when looking at the pattern and would even be misleeding if the " wasn't in [] .
if you're expecting the commands last parameter and it started with a " and you have a "; at the end is it neccessary to count pairs of "
Posted: 28 Apr 2008 08:18
by admin
Twisten wrote:well i'll try and give a simple example (its very late):
if i recall correctly this case gives a problem
RegExReplace $r, $s, "["`'](?=\d+)", " ";
are you saying that this will work fine, where $p=["`'](?=\d+):
RegExReplace $r, $s, $p, " ";
still i wasn't thinking that clearly with that idea since:
set $p, ["`'](?=\d+);
is subject to the same parsing, its seems the only way to make it work is to turn
["`'](?=\d+)
to
"[""`'](?=\d+)"
which feels just plain wrong to read when looking at the pattern and would even be misleeding if the " wasn't in [] .
if you're expecting the commands last parameter and it started with a " and you have a "; at the end is it neccessary to count pairs of "
I see 2 workable ways:
(1) double all " inside "..."
Code: Select all
Set $p, "[""`'](?=\d+)";
RegExReplace $r, $s, $p, " ";
It might feel wrong but it is pretty standard I think.
(2) 2 steps with a replacement
Code: Select all
Set $p, [@`'](?=\d+);
Replace $p, $p, @, """";
RegExReplace $r, $s, $p, " ";
Posted: 28 Apr 2008 20:16
by Twisten
yeah, i guess you're right, i'll get used to it. probably just feel akward because i've never had to do such things with programming languages and shell scripts.
Re: Various Script Wishes
Posted: 05 Nov 2008 16:52
by TheQwerty
Small and I would think very simple wish for a new variable.
<xyini> or <xyconfig> = Name of XY's current configuration.
Re: Various Script Wishes
Posted: 17 Nov 2008 10:24
by admin
TheQwerty wrote:Small and I would think very simple wish for a new variable.
<xyini> or <xyconfig> = Name of XY's current configuration.
Are you thinking of full path/name, filename, or file base?
Re: Various Script Wishes
Posted: 17 Nov 2008 13:31
by TheQwerty
admin wrote:TheQwerty wrote:Small and I would think very simple wish for a new variable.
<xyini> or <xyconfig> = Name of XY's current configuration.
Are you thinking of full path/name, filename, or file base?
Well the path should always be the same as <xydata>, right?
I was thinking the filename, but if the config file has to have an extension of INI for XY to use it then just the base would be fine.
Re: Various Script Wishes
Posted: 17 Nov 2008 13:40
by admin
TheQwerty wrote:admin wrote:TheQwerty wrote:Small and I would think very simple wish for a new variable.
<xyini> or <xyconfig> = Name of XY's current configuration.
Are you thinking of full path/name, filename, or file base?
Well the path should always be the same as <xydata>, right?
I was thinking the filename, but if the config file has to have an extension of INI for XY to use it then just the base would be fine.
Yes, always <xydata> and always INI, but depending on what you have in mind with it, what is returned could make a difference at least in usability. I think filename is okay (base.ext) for most uses (who knows I might allow extensions other than INI one day).
Re: Various Script Wishes
Posted: 17 Nov 2008 14:27
by TheQwerty
admin wrote:Yes, always <xydata> and always INI, but depending on what you have in mind with it, what is returned could make a difference at least in usability. I think filename is okay (base.ext) for most uses (who knows I might allow extensions other than INI one day).
My initial thought was a more advanced INI-Tweak editor.
I couldn't find jacky's original script that does it, but I believe it required defining all the tweaks in the script. This variable (along with <xydata>) should make it possible to use ReadFile to find the comments to determine all (or at least most) of the tweaks.
It might also be useful to users that work with multiple XY configs for whatever reason.
Re: Various Script Wishes
Posted: 17 Nov 2008 16:38
by PeterH
admin wrote:
Yes, always <xydata> and always INI, but depending on what you have in mind with it, what is returned could make a difference at least in usability. I think filename is okay (base.ext) for most uses (who knows I might allow extensions other than INI one day).
As long as scripts normally would *not* change the extension, I also think base.ext-form should be best.
The better that this would serve for a theoretical change of .ini-suffix...