Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FiveGeneral Functions (continued)

PadString Function

Overview

The PadString function returns a copy of a string with padding on its end (right side). The padding can either be spaces or a specified string.

Syntax/Parameters

Syntax

string = PadString ( string source, int size, [string pad], [boolean left] );

Parameters

source

A string to pad.

size

An int size of the string after the pad is complete. If source is larger than size, no padding will be applied. The string is not truncated and remains unchanged.

pad

An optional string to use as padding. If pad is not specified, the padding will be comprised of space characters (‘ ’) by default.

left

An optional boolean value that when not FALSE, will fill before the string. The default is FALSE.

Return Value

Returns a string that is the padded version of source as specified.

Remarks

If size exceeds the sum of the lengths of the source string and the pad string, the pad string will be repeated until the size requirement is met as closely as possible. If the pad string or the source string is larger than size, the PadString function will return the source string with no additional padding.

Use caution for multi character pad values. The pad function will stop mid sequence if the size is reached while adding a multi character pad, thus cutting off the pad string.

Related Functions

Platform Support

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

Legato IDE, Legato Basic