Page 1 of 2
Label Multi files, What am I missing here?
Posted: 06 Aug 2017 14:18
by karimmaster101
Hello, I am trying to label list of files (different location) but it seems my code has a problem. Here it is
Code: Select all
tag "Red","
E:\Files01\loremimpsu.mp4|
D:\Pictures\Example22.jpg
" ,0,0;
It works fine in case I am using one line format, like:
Code: Select all
tag "Red","E:\Files01\loremimpsu.mp4|D:\Pictures\Example22.jpg" ,0,0;
How can I fix the syntax so I can use the multi line format?
Re: Label Multi files, What am I missing here?
Posted: 06 Aug 2017 20:27
by highend
Look up the Heredoc/Nowdoc syntax in the help file
but this won't work in a single line like in your example...
Re: Label Multi files, What am I missing here?
Posted: 06 Aug 2017 21:43
by karimmaster101
Unfortunately, I didn't understand clearly what should I do. I used to use my script "The first format" with no problem with older version ver16 for example. Now with ver18 it didn't work. Should I roll back the upgrade?
If you wouldn't mind, more hints will be much appreciated
Re: Label Multi files, What am I missing here?
Posted: 06 Aug 2017 22:23
by highend
There aren't many more hints
These multiline script were working until 17.40.0200
and stopped working with 17.40.0201
The changelog doesn't mention any changes regarding this behavior...
Don, is this a bug?
Re: Label Multi files, What am I missing here?
Posted: 07 Aug 2017 04:55
by karimmaster101
highend wrote:There aren't many more hints
These multiline script were working until 17.40.0200
and stopped working with 17.40.0201
The changelog doesn't mention any changes regarding this behavior...
Don, is this a bug?
I installed the 17.40 version and it works as expected without any problem at all. It seem to me it is a bug in next versions, specially because Xyplorer didn't show any errors during the process. Even it shows that the process completed successfully and labels added to the files meanwhile they didn't.
Re: Label Multi files, What am I missing here?
Posted: 07 Aug 2017 09:45
by PeterH
From my point of view New Lines inside "" are not supported.
So maybe the first version only worked by chance? Or am I wrong?
Re: Label Multi files, What am I missing here?
Posted: 07 Aug 2017 09:47
by highend
I've tried 6 versions up to and including 17.40.0200 and in all of them
the new lines were working fine.
And if it isn't supported any more on purpose, at least a script
error should occur
Re: Label Multi files, What am I missing here?
Posted: 07 Aug 2017 13:50
by karimmaster101
highend wrote:I've tried 6 versions up to and including 17.40.0200 and in all of them
the new lines were working fine.
And if it isn't supported any more on purpose, at least a script
error should occur
Can't agree more, should I post a bug report now?
Re: Label Multi files, What am I missing here?
Posted: 08 Aug 2017 08:35
by highend
Don will read this thread anyway, so you can expect an answer here
Re: Label Multi files, What am I missing here?
Posted: 28 Sep 2017 05:24
by karimmaster101
Any news that the issue has been solved in latest version?
Re: Label Multi files, What am I missing here?
Posted: 28 Sep 2017 06:03
by bdeshi
Nope.
btw, I moved this topic to bug reports, because this apparently used to work.
Re: Label Multi files, What am I missing here?
Posted: 28 Sep 2017 10:45
by PeterH
Still I think, the correct form should be
(if it must be multiline, and without heredoc):
Code: Select all
tag "Red",
"E:\Files01\loremimpsu.mp4|"
."D:\Pictures\Example22.jpg"
,0,0;
At least I think the exact result of the original (in matter af spaces etc.) is undefined.
OK: with syntax check on, an error should be shown

Re: Label Multi files, What am I missing here?
Posted: 29 Sep 2017 11:50
by admin
1) You can see in the Step Mode dialog that one space is inserted between concatenated lines. This is done since 20120624.
2) In the tagging function I removed an auto-removal of flanking spaces on 20161221 (between v17.40.0200 and v17.40.0201).
The combination of this with the strange syntax used in the OP leads to the issue.
I will now reinvoke the auto-removal of flanking spaces (it did not make much sense anyway). So the issue will disappear for THIS context (SC tag).
BUT: Spaces will still be inserted generally (all contexts), so I cannot really recommend this syntax unless you are aware of what will happen (Step Mode is your friend)!
The parser cannot detect the possible problems here (too complex), so there cannot be any "Dubious Syntax" warning.
Re: Label Multi files, What am I missing here?
Posted: 29 Sep 2017 12:31
by PeterH
For me the question is: should it really be allowed to
continue a string over lines. I don't remember any language that allows this. And this wouldn't be so hard to test for a syntax warning.
I even seem(!) to remember that in the beginning of scripting you said that it's not allowed.
But I know - now that it was possible it might break old code...
(

Should you ever create a new language: be more restrictive from the start! Only allow what's explicitely allowed.

)
Re: Label Multi files, What am I missing here?
Posted: 29 Sep 2017 12:48
by bdeshi
admin wrote:I will now reinvoke the auto-removal of flanking spaces [...] for THIS context (SC tag).
BUT: Spaces will still be inserted generally (all contexts)
Why such an arbitrary exception?
The original script should be updated, and this should not be valid, as peterH suggested. Or if syntax detection is too difficult for this case, then just keep things as-is. The indenting space can be considered part of the continued string because it's within the quotes, logical.