Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

ApplyDefaultPath Function

Overview

The ApplyDefaultPath function tests the target as having a path and, if it does not, adds the base path.

Syntax/Parameters

Syntax

string = ApplyDefaultPath ( string name, string base );

Parameters

name

A string containing a filename with or without a path. The string can be a maximum of 512 characters.

base

A string representing the base path or filename with path. If the string contains a filename, it is removed. If the base has no filename, the path must contain a trailing slash to disambiguate the last path limb from a filename. The string can be a maximum of 512 characters.

Return Value

Returns a string containing either name or name added to base or an empty string on failure. Use the GetLastError function to retrieve error information.

Remarks

The ApplyDefaultPath function is a simple test and concatenate function for MS style paths and file names. It does not handle connecting ‘\’ characters and in fact will not process the base parameter as a default path if it or the name parameter contain any path characters. The ApplyDefaultPath function does not check for the validity of the resultant path.

If the value overflows, an empty string is returned and GetLastError will return ERROR_OVERFLOW.

Related Functions

Platform Support

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

Legato IDE, Legato Basic