🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14101

Re: SHGetSpecialFolderLocation!

#14101
From: Safari
Date: Tue, 26 Aug 2003 08:00
120 lines
4592 bytes
Hello & thanks Remy,
I am using C++Builder 6.0 Enterprise.

What defrence?
for (int x = 0; x < y; x++)  // if y > x;
for (int x = 0; x < y; ++x)

// Or for x := y downto 0 do
for (int x = y; x > 0; x--)  // if y > x;
for (int x = y; x > -1; x--)
for (int x = y; x > 0; --x)
for (int x = y; x > -1; --x)

Thanks again
Safari

"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f49a10c$1@newsgroups.borland.com...
|
| "Safari" <Safari@alloymail.com> wrote in message
| news:3F48E683.1000408@alloymail.com...
|
| > if (FindFirst(Path + "*.~*;*.tmp;*.temp;*.wri;*.doc", faAnyFile, Search)
|
| You cannot use multiple masks like that.  You can only use a single mask,
in
| which case you will have to use "*.*" as the mask instead and then test
each
| file that is found with the individual file extensions one at a time.  For
| example:
|
|     TSearchRec Search;
|     if( FindFirst(Path + "*.*", faAnyFile, Search) == 0 )
|     {
|         do
|         {
|             if( (Search.Name != ".") && (Search.Name != "..") )
|             {
|                 AnsiString ext = ExtractFileExt(Search.Name);
|                 if( ext.SubString(1, 2) == ".~" )
|                     //...
|                 else if ( AnsiSameText(ext, ".tmp") )
|                     //...
|                 else if( AnsiSameText(ext, ".temp") )
|                     //...
|                 else if( AnsiSameText(ext, ".wri") )
|                     //...
|                 else if( AnsiSameText(ext, ".doc") )
|                     // ...
|                 //...
|             }
|         }
|         while( FindNext(Search) == 0 );
|         FindClose(Search);
|     }
|
| Or:
|
|     const char* arr[] = {".tmp", ".temp", ".wri", ".doc"};
|
|     TSearchRec Search;
|     if( FindFirst(Path + "*.*", faAnyFile, Search) == 0 )
|     {
|         do
|         {
|             if( (Search.Name != ".") && (Search.Name != "..") )
|             {
|                 AnsiString ext = ExtractFileExt(Search.Name);
|                 bool bFound = false;
|
|                 if( ext.SubString(1, 2) == ".~" )
|                     bFound = true;
|                 else
|                 {
|                     for(int x = 0; x < 4; ++x)
|                     {
|                         if ( AnsiSameText(ext, arr[x]) )
|                         {
|                             bFound = true;
|                             break;
|                         }
|                     }
|                 }
|
|                 if( bFound )
|                     //...
|             }
|         }
|         while( FindNext(Search) == 0 );
|         FindClose(Search);
|     }
|
| Or, if you have an Enterprise edition of Builder:
|
|     #include <Masks.hpp>
|
|     const char* masks[] = {"*.~*", "*.tmp", "*.temp", "*.wri", "*.doc"};
|
|     TSearchRec Search;
|     if( FindFirst(Path + "*.*", faAnyFile, Search) == 0 )
|     {
|         do
|         {
|             if( (Search.Name != ".") && (Search.Name != "..") )
|             {
|                 for(int x = 0; x < 5; ++x)
|                 {
|                     if( MatchesMask(Search.Name, masks[x]) )
|                     {
|                         //...
|                         break;
|                     }
|                 }
|             }
|         }
|         while( FindNext(Search) == 0 );
|         FindClose(Search);
|     }
|
| Gambit
Technical Details
Message-ID: <3f4c124e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3F48E683.1000408@alloymail.com> <3f49a10c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,7ce38efab0f8f813
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-26 19:09:31 PST
From: "Safari" <Safari@alloymail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3F48E683.1000408@alloymail.com> <3f49a10c$1@newsgroups.borland.com>
Subject: Re: SHGetSpecialFolderLocation!
Date: Tue, 26 Aug 2003 12:30:39 +0430
Lines: 122
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 194.225.63.227
Message-ID: <3f4c124e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061950030 194.225.63.227 (26 Aug 2003 19:07:10 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail