xHarbour Reference Documentation > Function Reference |
Justifies a character sequence within a string.
AtAdjust( <cSearch> , ; <cString> , ; <nEndPos> , ; [<nCount>] , ; [<nSkipChars>], ; [<xInsChar>] ) --> cJustified
The function returns the justified string.
AtAdjust() begins searching <cSearch> in <cString> at the first plus <nSkipChars> characters. It terminates searching after <nCount> occurrences or after the last occurrence of <cSearch>. It inserts <xInsChar> up to <nEnpos> and returns returns modified string. The function recognizes the CSetAtMuPa() and SetAlike() settings.
See also: | AtNum(), CSetAtMuPa(), SetAtLike() |
Category: | CT:String manipulation , Character functions |
Source: | ct\atadjust.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example justifies a serias of character strings by // inserting dots into the result string. PROCEDURE Main LOCAL aNames := { "Hagen, Walter" , ; "McKenzie, Scott", ; "Ho, Li-Minh" } LOCAL cName FOR EACH cName IN aNames cName := AtAdjust( ",", cName, 12, 1, 0, "." ) ? CharRem( ", ", cName ) NEXT ** result // Hagen......Walter // McKenzie...Scott // Ho.........Li-Minh RETURN
http://www.xHarbour.com