GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The ExpandTabs function scans a string, locates tab characters (0x09), and expands the tabs with the specified character at the snap position.
Syntax/Parameters
Syntax
string = ExpandTabs ( string data, [int size], [char fill] );
Parameters
data
A source string containing the data to expand. The source cannot exceed 1,048,575 characters in size.
size
An optional int specifying the size of the tab stops. The value must be from 1 to 64. The default value is 8.
fill
An optional char specifying the character to use to replace/fill the tab area. If the fill is not a space, the tab character is not converted and the remaining stop area is filled with the fill character. The default value is space (0x20). See Remarks below.
Return Value
Returns a string with the adjusted data and tabs removed or an empty string on failure. Use the GetLastError function to retrieve error information.
Remarks
The ExpandTabs function is designed to perform two basic functions: expanding tabs and replacing them with spaces, and, expanding the tab area with a fill character. Replacing with spaces is effectively a method of making the string printable but the tab characters are lost and the string cannot be collapsed with tabs. The latter method allows for the character positions to be mapped correctly and the string to be collapsed after performing any desired actions.
Line-ending characters are accounted for in the process and will reset the tab stop position tracking to allow for the start of a new line.
Typically, the backspace character (0x08) is used as fill for collapsing. This character has no storage significance and is easily removed to restore the string.
Range errors on the size and fill parameters will result in a runtime error terminating the script.
The resulting string cannot exceed the maximum buffer size of 1,048,575. If it does, the GetLastError function will return ERROR_OVERFLOW.
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.