numsuffix for renameitem broken
numsuffix for renameitem broken
It simply doesn't produce any result no matter what scenario it finds.
Power-hungry user!!!
Re: numsuffix for renameitem broken
So I left it alone for some minutes, went back and it started working.
The only problem is it does this (top is newest; after a series of 4 operations):
Default_01_03.xml
Default_01_02.xml
Default_01_01.xml
Default_01.xml
instead of expected:
Default_04.xml
Default_03.xml
Default_02.xml
Default_01.xml
for a base file "Default.xml".
Pertinent command:
renameitem("Default_01.xml", "$xml", , "_01");
-because renameitem("Default.xml", "$xml", , "_01"); results null.
The only problem is it does this (top is newest; after a series of 4 operations):
Default_01_03.xml
Default_01_02.xml
Default_01_01.xml
Default_01.xml
instead of expected:
Default_04.xml
Default_03.xml
Default_02.xml
Default_01.xml
for a base file "Default.xml".
Pertinent command:
renameitem("Default_01.xml", "$xml", , "_01");
-because renameitem("Default.xml", "$xml", , "_01"); results null.
Power-hungry user!!!
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: numsuffix for renameitem broken
(Moved to "Tips & Tricks, Questions & Answer" because it is a usage question.)
I'm not sure what you want to achieve, but SC renameitem probably isn't the right way to go. The Help tells me that it is meant to only rename *one* item.
I'm not sure what you want to achieve, but SC renameitem probably isn't the right way to go. The Help tells me that it is meant to only rename *one* item.
FAQ | XY News RSS | XY Twitter
Re: numsuffix for renameitem broken
Numsuffix seems to not like finding a basename, admin, ie: it demands a first suffix to start appending more on top of it.
Trying
renameitem("Default.xml", "$xml", , "_01");
on $xml = "Default.xml" produces nothing.
So I'm forced to use
renameitem("Default_01.xml", "$xml", , "_01");
which then produces exotic Default_01_01.xml, Default_01_02.xml, Default_01_03.xml... files, when they should be simply
Default_01.xml, Default_02.xml, Default_03.xml.
I see no logical reason to be forced to such behavior.
Trying
renameitem("Default.xml", "$xml", , "_01");
on $xml = "Default.xml" produces nothing.
So I'm forced to use
renameitem("Default_01.xml", "$xml", , "_01");
which then produces exotic Default_01_01.xml, Default_01_02.xml, Default_01_03.xml... files, when they should be simply
Default_01.xml, Default_02.xml, Default_03.xml.
I see no logical reason to be forced to such behavior.
Power-hungry user!!!
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: numsuffix for renameitem broken
Works as advertised and makes sense to me.
What do you want to achieve? Input? Output?
What do you want to achieve? Input? Output?
FAQ | XY News RSS | XY Twitter
Re: numsuffix for renameitem broken
All due respect, the advertised behavior would be
renameitem("Default.xml", "$xml", , "_01");
producing "Default_01.xml" if target file ($xml) is "...\Default.xml", as there's no remark at all for the described case. Therefore the sequence would be
Default_02.xml
Default_03.xml
Default_04.xml
and so on, if and when required - which is the reason why numsufiix exists. Of course it's assumed that another "Default.xml" will be there when renameitem is executed again.
renameitem("Default.xml", "$xml", , "_01");
producing "Default_01.xml" if target file ($xml) is "...\Default.xml", as there's no remark at all for the described case. Therefore the sequence would be
Default_02.xml
Default_03.xml
Default_04.xml
and so on, if and when required - which is the reason why numsufiix exists. Of course it's assumed that another "Default.xml" will be there when renameitem is executed again.
Power-hungry user!!!
Re: numsuffix for renameitem broken
It makes sense that it should work this way, even if renameitem references the source file as it's destination file
because logically the destination file already exists -> Hence rename the current one.
because logically the destination file already exists -> Hence rename the current one.
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: numsuffix for renameitem broken
I don't agree, but I will add a flag to make it work as desired in this thread.
FAQ | XY News RSS | XY Twitter
Re: numsuffix for renameitem broken
Can't test the change for the time being but... thanks for listening!
Power-hungry user!!!
Re: numsuffix for renameitem broken
It works as expected with flags = 16...
One of my scripts helped you out? Please donate via Paypal