GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
Overview
The AddPaths function will combine two paths together and produce a string containing a resultant path.
Syntax/Parameters
Syntax
string = AddPaths ( string base, string target );
Parameters
base
A string containing a base path. The path does not require a trailing slash. base should generally be qualified but it is not required.
target
A string containing an unqualified target path. It cannot contain a root position but may contain one or more leading ‘../’ to perform up branch traversing.
Return Value
Returns a string containing the combined paths or an empty string on failure. Use the GetLastError function to retrieve error information.
Remarks
The AddPaths function takes two input paths and combines them to produce a resultant path. The second path (target) must be relative to the first (base) (i.e., within the same logical volume). The AddPaths function also performs path connector logic to properly resolve ‘..’ connectors to traverse up the path tree. The paths can be Windows or URI style. If they are URI and contain a scheme, the QualifyURL function must be used.
In the event of an error, the GetLastError function may return the following values (OR’ed with ERROR_SOFT):
AP_SOURCE_NOT_RELATIVE | 0x00010000 | Target is not relative path | |
AP_SOURCE_SYNTAX | 0x00020000 | Syntax error relative path | |
AP_SOURCE_EXCEEDS_ROOT | 0x00030000 | Up tree '..' went past root | |
AP_OVERFLOW | 0x00040000 | Result is too large (maximum 512 characters) |
Note that in this situation:
AddPaths("C:\\test\\data\\", "\\data1.txt");
the AddPaths function will return an empty string even though the path operation is technically correct.
The AddPaths function does not check for the validity of the resultant path.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.