mrdutchie Posted October 22, 2003 Posted October 22, 2003 Hello, this must be really simple, but I can't figure it out. I have this Procedure in another form. Public Sub checkfiles(ByVal continue As Boolean) continue = True fileExist = System.IO.File.Exists(databasepath + databasefile) If fileExist = False Then MsgBox("Error: Can't find the database file. Please check your setup and make sure your Database folder is correct.") continue = False End If fileExist = System.IO.File.Exists(configpath + configfile) If fileExist = False Then MsgBox("Error: Can't find the Configuration file. Please check your setup and make sure your Database folder is correct.") continue = False End If End Sub Now from my main program I can do this checkfiles(true) or checkfiles(false) But what I want is that it results a value. like this makesure=checkfiles() if makesure=False then end Did some searches but could not find anything, can someone help me out with this easy problem... Thanks so much Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 Public Function checkfiles() as Boolean fileExist = System.IO.File.Exists(databasepath + databasefile) If fileExist = False Then MsgBox("Error: Can't find the database file. Please check your setup and make sure your Database folder is correct.") Return False End If fileExist = System.IO.File.Exists(configpath + configfile) If fileExist = False Then MsgBox("Error: Can't find the Configuration file. Please check your setup and make sure your Database folder is correct.") Return False End If Return True End Function Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mrdutchie Posted October 22, 2003 Author Posted October 22, 2003 Thank you :) I knew it was something simple. Couldn't figure out the "Return True/False" part. Now I know how that works. Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.