#11 2013-02-02 07:45

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: PascalScript to run one time only and get current file index

Could we know if the name of the function going to be changed or not?

I want to update some old scripts but I'd prefer to wait than do it twice.


If this software has helped you, consider getting your pro version. :)

Offline

#12 2013-02-04 23:01

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: PascalScript to run one time only and get current file index

I'm not sure about it. Is there any benefit in knowing how many files are there including the unmarked ones?

Unmarked files are excluded from renaming and previewing, so they should be irrelevant. Also, if Index is based on the total marked+unmarked files, then index between consecutive files in preview can jump by more than 1 and it is less intuitive I think.

Offline

#13 2013-02-05 07:48

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: PascalScript to run one time only and get current file index

Hi Denis, our point was just the naming of that commando.
Since "GetTotalNumberOfFiles" give us the amount of the marked files,
we have suggested to name that command "GetNumberOfSelectedFiles" instead.
Or "GetNumberOfMarkedFiles". Just to make it more clear.
Because "GetTotalNumberOfFiles" implies to me Get Total Number Of Files from folder.

Wiki wrote:

A file is marked by putting a tick in its check box.
Conversely, it is unmarked by removing the tick.
ReNamer acts only on the marked files. An unmarked file is neither previewed nor renamed.

ReNamer:Adding_files_and_folders#Marking_and_Unmarking_the_files

- - -

Denis wrote:

Is there any benefit in knowing how many files are there including the unmarked ones?

Could be. But at the moment i have no use for an command like "GetNumberOfFilesInList".

I think we just were not clear in our words.

But i would have an use if the old name "GetTotalNumberOfFiles"
would be reused for an new command to give me what "TotalFilesOnFolder" in this code does:

WideScanDirForFiles(WideExtractFilePath(FilePath), FilesArray, false, false, false, '*');
TotalFilesOnFolder := IntToStr(length(FilesArray));

Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#14 2013-02-05 10:13

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: PascalScript to run one time only and get current file index

What about GetFileIndexLength?, it would then match to it's pair GetCurrentFileIndex


If this software has helped you, consider getting your pro version. :)

Offline

#15 2013-02-06 09:54

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: PascalScript to run one time only and get current file index

Thinking a little on my suggestion it might not be very clear. Being the FileIndex a number, and trying to use it with the meaning of a list may not be a good idea...

I think Stefan's GetNumberOfMarkedFiles is the best one until now.


If this software has helped you, consider getting your pro version. :)

Offline

#16 2013-02-07 20:44

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: PascalScript to run one time only and get current file index

I think you guys are right. How about the following names?

GetCurrentFileIndex and GetCurrentMarkedFileIndex
GetTotalNumberOfFiles and GetTotalNumberOfMarkedFiles

This will provide clearer names and also both of functions (marked and total).

Offline

#17 2013-02-07 21:13

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: PascalScript to run one time only and get current file index

I tend to do this often - asking question and then implementing it anyway without waiting for a response. It's probably because I got time now so I can simply implement it instead of waiting for another week or two before I get a chance to do this wink

These functions are added in v5.60.25 Beta.

Wiki has been updated: ReNamer:Pascal_Script:Functions#Application

Offline

Board footer

Powered by FluxBB