Format
Combines strings and extracts a specific substring of a string. You can format the result to a specific length and fill it with appropriate characters.
SYNTAX |
|
||||||||||||
ARGUMENTS |
|
||||||||||||
RETURN | Formatted text |
Example
Date = "1.7.2014"
Day = Format(3, 1, 2, "R", "0",Date) ; Day ==> "07"
Month = Format(1, 1, 2, "R", "0",Date) ; Month ==> "01"
Year = Format(5, 4, 4, "R", "0",Date) ; Year ==> "2014"
;-------------------------------------------
Name = "John James Miller"
; subst without padding
Name1 = Format(6, 50, 0, "L", "_", Name); Name1 = "James Miller"
Name2 = Format( 1, 10, 0, "L", "_", Name); Name2 = "John James"
Name3 = Format(6, 5, 0, "L", "_", Name); Name3 = "James"
; subst with padding, text left aligned
Name4 = Format(6, 50, 20, "L", "_", Name); Name4 = "James Miller________"
; subst with padding, text right aligned
Name5 = Format(6, 50, 20, "R", "_", Name); Name5 = "________James Miller"
; subst with padding, text centered
Name6 = Format(6, 50, 20, "Z", "_", Name); Name6 = "____James Miller____"