[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

12/24/2006 at 04:17AM PST, ID: 22102633
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

How to rename directories and files given a certain mask?(2)

Asked by PeterdeB in Delphi Programming

Hi Folks,

This is what I have so far >

// TName's code

procedure DelChar(p,FName: String;c:Char);
var i,len: Integer;
NewName:String;
done:Boolean;
begin
  i:=1;
  NewName:='';
  len:=Length(FName);
  Done:=False;
  while i<Len+1 do  begin
    if (FName[i]<>c) or done then
       NewName:=NewName+FName[i]
    else
       if (FName[i]<>c) then
         Done:=True;
    inc(i);
  end;

  try
    RenameFile(p+FName, p+NewName);  //What should happen if ´the file NewName already exists?
  except
   ShowMessage('File'+ p+NewName + 'already exists!');
  end;
end;


  procedure ScanDirs(path: String;c:Char);
var sr: TSearchRec;
begin
  if path[Length(path)] <> '\' then
    path := path + '\';
  if FindFirst(path + '*.*', faAnyFile, sr) = 0 then
  begin
    repeat
       DelChar(path,sr.Name,c);
    until FindNext(sr) <> 0;
    FindClose(sr);
  end;
  if FindFirst(path + '*.*', faAnyFile, sr) = 0 then
  begin
    repeat
      if (sr.Name <> '.') and (sr.name <> '..') then
        if (sr.Attr = faDirectory) or (sr.Attr = faAnyFile) then
          ScanDirs(path + sr.Name + '\', c);
    until FindNext(sr) <> 0;
    FindClose(sr);
  end;
end;



procedure TForm1.Button1Click(Sender: TObject);
begin
  ScanDirs('C:\Test','!');
end;

end.

//

This works like a charm and removes all ! chars from both dirs and files just like it should do. Although it should not occur normally, sometimes dupes enter the library. Dupes of name size and content. When this occurs, these files will not be touched obviously. All other files will however. I would like to have the above code modified to prevent myself from running into the problem of having only some files renamed. At all costs this should be prevented so a messagebox with several options should pop up which would provide options to tackle the problem or offer whatever actions which would help solving the problem. A dupe scan prior to the DirsCan prsenting a list with dupes and coarse of actions to have them renamed using another function or procedure?

Kind regards,

Dweep

[+][-]12/24/06 06:01 AM, ID: 18194244

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/24/06 06:26 AM, ID: 18194280

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/24/06 07:57 AM, ID: 18194408

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Delphi Programming
Sign Up Now!
Solution Provided By: TName
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12/24/06 08:01 AM, ID: 18194409

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/24/06 08:15 AM, ID: 18194431

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12/24/06 08:22 AM, ID: 18194445

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/24/06 02:02 PM, ID: 18194971

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/27/06 10:49 AM, ID: 18203880

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/23/07 03:36 AM, ID: 18373970

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01/24/07 06:00 AM, ID: 18385587

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/27/07 07:47 AM, ID: 18410331

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74