Re: Strip filename + thanks!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Re: Strip filename + thanks!

  1. #1
    Ante Guest

    Re: Strip filename + thanks!



    Just what I needed! Thank you Randy!! ..And everybody else who has waisted
    precious time with me and all my problems.


    But, is there any (simle) way to detemine if the path point to a folder or
    a file?


    A happy weekend to you all!
    /Ante




    "Randy Birch" <rgb@mvps.org> wrote:
    >Private Declare Function PathRemoveFileSpec Lib "shlwapi.dll" _
    > Alias "PathRemoveFileSpecA" _
    > (ByVal pszPath As String) As Long
    >
    >
    >Private Sub Command3_Click()
    >
    > Dim sFile As String
    >
    > sFile = "c:\winnt\calc.exe"
    >
    > If PathRemoveFileSpec(sFile) <> 0 Then 'success
    >
    > Text3.Text = sFile
    >
    > End If
    >
    >End Sub
    >
    >
    >
    >
    >--
    >Randy Birch, MVP Visual Basic
    >Take the Microsoft / VBnet Developer's poll at http://www.mvps.org/vbnet/
    >
    >http://www.mvps.org/vbnet/
    >http://www.mvps.org/ccrp/
    >news://news.mvps.org/
    >
    >Please correspond only using the newsgroups so all can benefit.
    >
    >
    >"Ante" <ante95@hotmail.com> wrote in message
    >news:39eebc7b$1@news.devx.com...
    >|
    >|
    >|
    >| GIGANT thanks to anyone who can help me out.
    >| If you can, email me at ante95@hotamil.com
    >|
    >| /Ante
    >
    >



  2. #2
    mrfelis Guest

    Re: Strip filename + thanks!

    on error resume next 'In case doesn't exist
    bFolder = ((GetAttr(sPath) And vbDirectory)=vbDirectory)
    on error goto 0 'Or appropriate error handeler
    --
    ~~~
    C'Ya,
    mrfelis
    mrfelis@yahoo.NOSPAM.com
    just remove the spam
    Ante <ante95@hotmail.com> wrote in message news:39f020c4$1@news.devx.com...
    >
    >
    > Just what I needed! Thank you Randy!! ..And everybody else who has waisted
    > precious time with me and all my problems.
    >
    >
    > But, is there any (simle) way to detemine if the path point to a folder or
    > a file?
    >
    >
    > A happy weekend to you all!
    > /Ante
    >
    >
    >
    >
    > "Randy Birch" <rgb@mvps.org> wrote:
    > >Private Declare Function PathRemoveFileSpec Lib "shlwapi.dll" _
    > > Alias "PathRemoveFileSpecA" _
    > > (ByVal pszPath As String) As Long
    > >
    > >
    > >Private Sub Command3_Click()
    > >
    > > Dim sFile As String
    > >
    > > sFile = "c:\winnt\calc.exe"
    > >
    > > If PathRemoveFileSpec(sFile) <> 0 Then 'success
    > >
    > > Text3.Text = sFile
    > >
    > > End If
    > >
    > >End Sub
    > >
    > >
    > >
    > >
    > >--
    > >Randy Birch, MVP Visual Basic
    > >Take the Microsoft / VBnet Developer's poll at http://www.mvps.org/vbnet/
    > >
    > >http://www.mvps.org/vbnet/
    > >http://www.mvps.org/ccrp/
    > >news://news.mvps.org/
    > >
    > >Please correspond only using the newsgroups so all can benefit.
    > >
    > >
    > >"Ante" <ante95@hotmail.com> wrote in message
    > >news:39eebc7b$1@news.devx.com...
    > >|
    > >|
    > >|
    > >| GIGANT thanks to anyone who can help me out.
    > >| If you can, email me at ante95@hotamil.com
    > >|
    > >| /Ante
    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center