Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_wrap() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_WRAP()

 DESCRIPTION

 C_WRAP() takes a specified string and word-wraps it based on the
 given width.  The processed string is then suitable for display.

 SYNTAX

 C_WRAP(src_string, tar_string, width)

 PARAMETERS

 src_string (C) is the name of the source string to wrap.  The
 src_string should be a character string with soft carriage returns
 (ASCII 141) removed and tab characters (ASCII 9) expanded.  The
 functions C_SOFTLEN() and C_SOFTCR() can be used to convert the
 string.  The src_string will be wrapped to the specified width and
 placed in tar_string so the contents of src_string remain unchanged.

 tar_string (C) is the name of the target string to place the
 wrapped text.  The tar_string argument must be declared to the
 correct size before calling this function.  Use C_WRAPLEN() to
 determine the size needed when the string is wrapped.

 width (N) is the width the word-wrapped text should be when placed
 in tar_string.  The value of width should be the same value used
 with C_WRAPLEN().

 RETURNS

 There is no return value.

 EXAMPLES

 use test
 xmemo = test->memofld           && store database memo field

 xlen = c_softlen(xmemo)         && | strip out soft carriage returns
 tmp_memo = space(xlen)          && | and expand any tab characters
 c_softcr(xmemo,tmp_memo)        && | using C_SOFTLEN() and C_SOFTCR().

 xlen = c_wraplen(tmp_memo,40)   && determine the size of wrapped text
 new_memo = space(xlen)          && allocate space for new string
 c_wrap(tmp_memo,new_memo,40)    && wrap tmp_memo to 40, place in new_memo


See Also: C_WRAPLEN() C_SOFTLEN() C_SOFTCR() C_VIEWSTR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson