xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

CharSpread()

Formats a character string for block paragraphs.

Syntax

CharSpread( <cString>  , ;
            <nLineLen> , ;
           [<xInsChar>]  ) --> cResult

Arguments

<cString>
This is a character string to format for a block paragraph.
<nLineLen>
A numeric value specifying the length of a line in the block paragraph (fixed font).
<xInsChar>
This parameter defaults to 32, i.e. Chr(32) is inserted into <cString> for formatting. <xInsChar> is either a numeric ASCII code or a single character of Valtype()="C".

Return

The function returns a string formatted to the length of <nLineLen>. The string is expanded by inserting <xInsChar> between words. If <xInsChar> is not contained in <cString>, the function returns a unchanged string.

Info

See also:Center(), CharOne(), Expand()
Category: CT:String manipulation , Character functions
Source:ct\spread.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

   PROCEDURE Main
      LOCAL cString := "The xHarbour compiler"

      ? CharSpread( cString, 35 )

      // result: "The        xHarbour        compiler"
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe