GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The DurationToComponents function parses a formatted duration string and returns a list of components. For example, “P1M” returns 100 or one month.
Syntax/Parameters
Syntax
PVALUE [] = DurationToComponents ( string duration );
Parameters
duration
A string containing an XML/ISO-8601 formatted duration string.
Return Value
Returns a PVALUE (dword) array containing the duration components or an empty array on failure. Use the GetLastError function to retrieve error information.
Remarks
The values are returned in 100ths using as PVALUE (or dword). The SGMLValueToString function can be used to convert the value to a string or used as fixed decimal point integers (two decimal places). Related math functions can also be used.
The returned array elements are named as follows:
Key Name | Description | |||
Negative | Present and set to non-zero if the string was preceded by a dash (‘-’) symbol. | |||
Years | Years, if specified. | |||
Months | Months, if specified. | |||
Weeks | Weeks, if specified | |||
Days | Days, if specified. | |||
Hours | Hours, if specified.. | |||
Minutes | Minutes, if specified. | |||
Seconds | Seconds, if specified. |
If a value is not specified, the key name will not be present in the list.
This function differs from DurationToTimeComponents in that it does not perform any analysis of the data. For example, if the “P28M” months is processed, the result is 2800 or 28.00 months. If processed by DurationToTimeComponents, the result would be 2 years and 4 months.
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.