Results 1 to 5 of 5

Thread: Check Directory if FIle exist

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Posts
    111

    Check Directory if FIle exist

    TO Check if file exist in a Folder

    VB Code:
    1. If Converted.txt Exist in Dir Then
    2.  
    3.  Open App.Path & "\210\February\Converted.txt" For Input As #1
    4.              Do Until EOF(1)
    5.                  Input #1, a, b, C, D
    6.                  Set itm = lv(intInd).ListItems.Add(, , a)
    7.                      itm.SubItems(1) = b
    8.                      itm.SubItems(2) = C
    9.                      itm.SubItems(3) = D
    10.                 Loop
    11. Else
    12.  
    13. cmdLoad.Enabled = False
    14. chkLoad.Enabled = False
    15. Exit Sub
    16. End If

    vbMarkO

  2. #2

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Like:
    VB Code:
    1. If Len(Dir$(App.Path & "\210\February\Converted.txt")) <> 0 Then


    Edit: Or use:
    VB Code:
    1. If Dir$(App.Path & "\210\February\Converted.txt") <> "" Then


    Bruce.
    Last edited by Bruce Fox; Feb 12th, 2004 at 08:56 PM.

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    So I guess for next time, actually ask a question instead of making a phrase then hide something in your code.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Posts
    111
    Originally posted by Bruce Fox
    Like:
    VB Code:
    1. If Len(Dir$(App.Path & "\210\February\Converted.txt")) <> 0 Then


    Edit: Or use:
    VB Code:
    1. If Dir$(App.Path & "\210\February\Converted.txt") <> "" Then


    Bruce.
    That worked great thank you...

    As for the guys Oooops my Bad forgot to put a ?

    Glad he caught it though

    Ill try harder next time!!!

    vbMarkO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width