GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
TrailStringAfterAlways Function
Overview
The TrailStringAfterAlways function will truncate the target string if it exceeds the specified size and add an ellipse style trail (‘...’) no matter the size of the string.
Syntax/Parameters
Syntax
string = TrailStringAfterAlways ( string source, int size );
Parameters
source
A string.
size
An int specifying the size of the string before the trail. If the string exceeds the size less than 3, the source will be trailed off. The value must be > 4 and less than 1MB. Under circumstances where the string may be larger that 1MB, use the GetStringSegment function to pre-trim the string.
Return Value
Returns a string as an altered version of the source string.
Remarks
Unlike the TrailStringAfter function, the TrailStringAfterAlways function always adds the trailing ellipses even if the string does not exceed the length specified by the size parameter. If the source parameter does not exceed the size, the function will still add the trail off. This is useful for displaying a string in a limited space without roughly truncating but rather adding a “trail off” indicator. The GetLastError function can return ERROR_RANGE if the size parameter does not conform to the above specification.
There are multiple methods of “trailing off” strings. The following illustrates examples:
string s1, s2; s1 = "This is the story of my cats, purry, furry and cute"; AddMessage("Original String :%s:", s1); s2 = TrailStringAfter(s1, 20); AddMessage("TrailStringAfter :%s:", s2); s2 = TrailStringAfterAlways(s1, 20); AddMessage("TrailStringAfterAlways :%s:", s2); s2 = TrailStringAfterAlways(s1, 1000); AddMessage("TrailStringAfterAlways :%s:", s2); s2 = TrailStringBefore(s1, 25); AddMessage("TrailStringBefore :%s:", s2);
Results in the following placed in the log:
Original String :This is the story of my cats, purry, furry and cute: TrailStringAfter :This is the stor...: TrailStringAfterAlways :This is the stor...: TrailStringAfterAlways :This is the story of my cats, purry, furry and c...: TrailStringBefore :...purry, furry and cute:
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.