Results 1 to 5 of 5

Thread: [RESOLVED] idea anyone?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    93

    Resolved [RESOLVED] idea anyone?

    i have a bit of a problem and am not sure how to fix it. right now, my program searches for a file "C:\lfs.rtc", if that file does not exist, the program crashes.the user creates the file with my program and my program shells the first line in the file. I am not sure what to do. any ideas?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: idea anyone?

    Trap the error and handle it the way you want it handled.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: idea anyone?

    Show your code.

    You can test if a file xists using the Dir function.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    93

    Re: idea anyone?

    VB Code:
    1. Private Sub Command2_Click()
    2.     Dim strFile() As String
    3.     Dim i As Integer
    4.         Open "C:\lfs.rtc" For Input As #1
    5.         strFile = Split(Input$(LOF(1), 1), vbNewLine)
    6.     Close #1
    7.        For i = 0 To UBound(strFile)
    8.     Shell strFile(i), vbNormalFocus
    9.     Next
    10.    
    11.     End Sub
    i fixed the crash, but i still get an error. The crash was an error and i had the program close when the other one is launched.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    93

    Re: idea anyone?

    i got it figured out. Thanks anyways.

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