470,855 Members | 1,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

FSO FileExists Method

I would like to know if I'm correct in the way I coded this:

Function CheckFileExists(sFileName)
If (fs.FileExists(sFileName)) Then
CheckFileExists = True
Else
CheckFileExists = False
End If
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as
sFileName

Thanks from this ASP Newbie
Jul 19 '05 #1
4 6092
Hi David,

That should work, although you don't really have to encapsulate it in a
function like that. You can just do:
If fs.FileExists("C:\Path\file.xt") Then
'''code
Else
'''code
End If

Ray at work

"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to know if I'm correct in the way I coded this:

Function CheckFileExists(sFileName)
If (fs.FileExists(sFileName)) Then
CheckFileExists = True
Else
CheckFileExists = False
End If
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as sFileName

Thanks from this ASP Newbie

Jul 19 '05 #2
You could always check with some basic debugging:
Function CheckFileExists(sFileName)
response.write "Filename is " & sFileName
...

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as sFileName

Jul 19 '05 #3
Thanks Ray

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi David,

That should work, although you don't really have to encapsulate it in a
function like that. You can just do:
If fs.FileExists("C:\Path\file.xt") Then
'''code
Else
'''code
End If

Ray at work

"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to know if I'm correct in the way I coded this:

Function CheckFileExists(sFileName)
If (fs.FileExists(sFileName)) Then
CheckFileExists = True
Else
CheckFileExists = False
End If
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an actual file path is what is being passed to the Function CheckFileExists

as
sFileName

Thanks from this ASP Newbie


Jul 19 '05 #4
Heh,
Thanks Aaron, you proved why I use the sig: Thanks from this ASP NEWBIE =)

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
You could always check with some basic debugging:
Function CheckFileExists(sFileName)
response.write "Filename is " & sFileName
...

I just want to make sure that (Whichfolder & flindex & ".tif") which is an actual file path is what is being passed to the Function CheckFileExists

as
sFileName


Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Poppy | last post: by
11 posts views Thread by Dave Rahardja | last post: by
4 posts views Thread by daniel.w.gelder | last post: by
7 posts views Thread by greenflame | last post: by
5 posts views Thread by Nick Flandry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.