[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+--------+#################################################################
#+-| TRIM() |---------------------------------------------------+#############
#| +--------+ Removes all leading and trailing blank characters |#############
#+--------------------------------------------------------------+#############
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE string.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |----------------------------------+#############################
#| FUNCTION CHAR trim PROTOTYPE |#############################
#| PARAMETERS CONST CHAR source_string |#############################
#+----------------------------------------------+#############################
##############################################################################
##############################################################################
###########+---| Description |------------------------------------+###########
###########| The trim() function removes all leading and trailing |###########
###########| blank characters from source_string. This function |###########
###########| is identical to: |###########
###########| |###########
###########| ltrim( rtrim( source_string )). |###########
###########+------------------------------------------------------+###########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * trim command line before opening a file. |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| PARAMETERS CONST CHAR command_line |#########
#########| |#########
#########| IF .NOT. fb_open( h, trim( command_line ), &B_READ |#########
#########| ? "Unable to locate ",command_line |#########
#########| QUIT |#########
#########| ENDIF |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * See if an entry will fit into a database field. |#########
#########| |#########
#########| IF trim( entry ) > 20 |#########
#########| ? "Entry does not fit..." |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
left()
ltrim()
right()
rtrim()
substr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson