ifPath

NameDescription
roPathThe roPath component provides developers an easy way to create valid file system paths

Supported methods

Change(path as String) as Boolean

Description

Modifies or changes the current path via the specified relative or absolute path.

NameReturn TypeParametersReturn ValueDescription
ChangeBoolean${changeparamTable}Returns true if the resulting path is valid, otherwise false

Parameters

NameTypeDescription
pathStringThe new relative or absolute file system path to be used.

Return Value

A flag indicating whether the path was successfully changed.

IsValid() as Boolean

Description

Checks whether the current path is valid (the path is correctly formed). This does not check whether the file actually exists.

Return Value

A flag indicating whether the current path is valid.

Split() as Object

Description

Returns an roAssociativeArray containing keys for the parent directories, extensions, and file name in the file path.

Return Value

An roAssociativeArray that contains the following keys:

NameTypeDescription
basenameStringThe filename, without parent directories or extension.
extensionStringThe filename, with extension, without parent directories.
filenameStringThe filename.
parentStringThe parent directory, or empty if in a root directory.
phyStringThe PHY volume.

Example (Brightscript Debugger Interactive Shell)

> mypath = CreateObject("roPath", "pkg:/source/appMain.brs")
> ? myPath.Split()
parent: pkg:/source/
extension: .brs
phy: pkg:
basename: appMain
filename: appMain.brs