BuildPath Method

 

Description

 

Appends a name to an existing path.

 

PowerBASIC Syntax

 

METHOD BuildPath ( _

BYVAL bstrPath AS STRING, _

BYVAL bstrName AS STRING _

) AS STRING

 

Arguments

 

bstrPath

BSTR. Existing path to which name is appended. Path can be absolute or relative and need not specify an existing folder.

bstrName

BSTR. Name being appended to the existing path.

 

Return Value

 

BSTR. The new path.

 

Remarks

 

The BuildPath method inserts an additional path separator between the existing path and the name, only if necessary.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM strNewPath AS STRING

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Builds a path

strNewPath = fso.BuildPath(UCODE$("A:\MyFolder\"), UCODE$("New Folder"))

MSGBOX ACODE$(strNewPath)

 

 

Valid XHTML 1.0 Transitional