Check that file exists: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 854: | Line 854: | ||
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a filesystem, just namespaced variables. --> |
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a filesystem, just namespaced variables. --> |
||
{{omit from|Befunge}} <!-- No filesystem support --> |
{{omit from|Befunge}} <!-- No filesystem support --> |
||
=={{header|VBScript}}== |
|||
<lang vbscript>Set FSO=CreateObject("Scripting.FileSystemObject") |
|||
Function FileExists(strFile) |
|||
if FSO.fileExists(strFile) then |
|||
FileExists=true |
|||
else |
|||
FileExists=false |
|||
end if |
|||
end function |
|||
Function folderExists(strFolder) |
|||
if FSO.folderExists(strFolder) then |
|||
folderExists=true |
|||
else |
|||
folder exists=false |
|||
end if |
|||
end function |
|||
'''''usage (apostrophes indicate comments-this section will not be run)''''' |
|||
'if fileExists("C:\test.txt") then |
|||
'msgbox"It Exists!" |
|||
'else |
|||
'msgbox"awww" |
|||
'end if |
|||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' |
|||
</lang> |