[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+----------+###############################################################
#+-| CENTER() |-------------------------------------------+####################
#| +----------+ Centers the string within specified width |###################
#+--------------------------------------------------------+###################
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE string.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |-----------------------------------------------------+##########
#| FUNCTION CHAR center PROTOTYPE |##########
#| PARAMETERS CONST CHAR string, VALUE UINT string_length |##########
#+-----------------------------------------------------------------+##########
##############################################################################
##############################################################################
########+---| Description |------------------------------------------+########
########| The center() function returns a character string of length |########
########| string_length with string centered on the screen. |########
########+------------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Print centered page identifier for a report. |#########
#########| |#########
#########| ? center( dtoc(today())+" Report: Sales",80) |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Print a centered sign-on message. |#########
#########| |#########
#########| VARDEF |#########
#########| CHAR(40) signon[4] = "G.L. Module","by",; |#########
#########| "Peak Software",; |#########
#########| "(C) 1989, Peak, Inc" |#########
#########| INT i |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| |#########
#########| FOR i = 0 TO 3 |#########
#########| ? center( signon[i], 80 ) |#########
#########| NEXT |#########
#########| |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
space()
stuff()
substr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson