Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted
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

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...