|
-
Feb 2nd, 2007, 06:21 PM
#1
Thread Starter
Lively Member
[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?
-
Feb 2nd, 2007, 06:25 PM
#2
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
-
Feb 2nd, 2007, 07:07 PM
#3
Frenzied Member
Re: idea anyone?
Show your code.
You can test if a file xists using the Dir function.
-
Feb 2nd, 2007, 07:28 PM
#4
Thread Starter
Lively Member
Re: idea anyone?
VB Code:
Private Sub Command2_Click()
Dim strFile() As String
Dim i As Integer
Open "C:\lfs.rtc" For Input As #1
strFile = Split(Input$(LOF(1), 1), vbNewLine)
Close #1
For i = 0 To UBound(strFile)
Shell strFile(i), vbNormalFocus
Next
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.
-
Feb 2nd, 2007, 07:41 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|