GetFile Method

 

Description

 

Returns a File object corresponding to the file in a specified path.

 

PowerBASIC Syntax

 

METHOD GetFile ( _

BYVAL bstrFileSpec AS STRING _

) AS IFile

 

Arguments

 

bstrFileSpec

BSTR. The bstrFileSpec argument is the path (absolute or relative) to a specific file.

 

Return Value

 

IDispatch. Reference to a IFile interface.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pFile AS IFile

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to a file

pFile = fso.GetFile(UCODE$("C:\MyFolder\Test.txt"))

 

Valid XHTML 1.0 Transitional