Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

PathLevelUp Function

Overview

The PathLevelUp function trims a branch of the path of a string.

Syntax/Parameters

Syntax

string = PathLevelUp ( string path );

Parameters

path

A string containing a path.

Return Value

Returns a string containing the adjusted path or an empty string is returned if path does not contain path delimiters.

Remarks

The PathLevelUp function merely looks back from the end of a string until a slash or backslash is located and trims off the string back to that point. If a filename is attached to the path, it will be clipped and the path will remain. If the path string contains a trailing slash, it is removed and then the scan for the next slash starts. If there are no remaining slashes, an empty string is returned.

For example:

Before   After
R:\Path1\Path2\   R:\Path1\
R:\Path1\Path2   R:\Path1\
R:\Path1\cat.htm   R:\Path1\
R:\   (empty)

 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic