home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
FOXPRO
/
FCT1_12
/
FC_STR.HDR
< prev
next >
Wrap
Text File
|
1991-06-20
|
5KB
|
200 lines
#output Force Tools 1.2 - String functions
*
* return the complement of a string for descending indexing
*
function char decsend prototype
params const char str
*
* return soundex code for string
*
function char(4) soundex prototype
params const char str
*****************
* AllTrim(<CHAR>)
*
* Return a string with leading and trailing
* spaces removed
*
FUNCTION CHAR AllTrim PROTOTYPE
PARAMS CONST CHAR
*************************
* StrZero(<LONG>, <UINT>)
*
* Convert numeric to string with
* leading spaces
*
* Para 2 : Number of digits to return
*
FUNCTION CHAR StrZero PROTOTYPE
PARAMS VALUE ULONG, VALUE UINT
*--- return a token from a search string
function char token prototype
params const char search_str, const char token_list, value uint token_no
*--- return number of tokens in a search string
function uint num_token prototype
params const char search_str, const char token_list
*--- return initial position of a token
function uint at_token prototype
params const char search_str, const char token_list, value uint token_no
*************************
* CharXor(<CHAR>, <CHAR>)
*
* Return the XOR of two strings (Encrypt / Decrypt)
*
* Para 1 : String to En(De)Crypt
* Para 2 : String to XOR with
*
FUNCTION CHAR CharXor PROTOTYPE
PARAMS CONST CHAR, CONST CHAR
***********************
* Upper_AllTrim(<CHAR>)
*
* Uppercase and alltrim a string
*
FUNCTION CHAR Upper_AllTrim PROTOTYPE
PARAMS CONST CHAR
***********************
* Lower_AllTrim(<CHAR>)
*
* Lowercase and alltrim a string
*
FUNCTION CHAR Lower_AllTrim PROTOTYPE
PARAMS CONST CHAR
*********************
* Pad(<CHAR>, <UINT>)
*
* Pad right with spaces
*
* Para 1 : String to pad
* Para 2 : number of spaces to add
*
FUNCTION CHAR Pad PROTOTYPE
PARAMS CONST CHAR, VALUE UINT
**********************************
* Pad_Left(<CHAR>, <UINT>, <BYTE>)
*
* Pad left with specified char
*
* Para 1 : String to pad
* Para 2 : number of para 3 to pad with
* Para 3 : char to pad with
*
FUNCTION CHAR Pad_Left PROTOTYPE
PARAMS CONST CHAR, VALUE UINT, VALUE BYTE
**********************************
* Pad_Right(<CHAR>, <UINT>, <BYTE>)
*
* Pad right with specified char
*
* Para 1 : String to pad
* Para 2 : number of para 3 to pad with
* Para 3 : char to pad with
*
FUNCTION CHAR Pad_Right PROTOTYPE
PARAMS CONST CHAR, VALUE UINT, VALUE BYTE
*********************
* Rat(<CHAR>, <CHAR>)
*
* Search from the right for a char
*
* Para 1 : string to find
* Para 2 : string to search
*
FUNCTION UINT Rat PROTOTYPE
PARAMS CONST CHAR, CONST CHAR
*************************
* Ltoc(<LOGICAL>, <CHAR>)
*
* Convert logical to a char
*
* Para 1 : logical
* Para 2 : char's to use, example 'YN'
* first char is for .t.
*
FUNCTION CHAR Ltoc PROTOTYPE
PARAMS VALUE LOGICAL, CONST CHAR
**************
* Dtos(<DATE>)
*
* Convert date to a char YYYYMMDD
*
FUNCTION CHAR Dtos PROTOTYPE
PARAMS VALUE DATE
**************
* Pack(<CHAR>)
*
* Pack a string containing numeric digits to
* a special BCD like format resulting in half the len
*
* Example : X = Pack('01234567') && Pack numeric digits
* ? LEN(x) && 4
*
FUNCTION CHAR Pack_Str PROTOTYPE
PARAMS CONST CHAR
****************
* UnPack(<CHAR>)
*
* Unpack a packed string to the
* orginal digits
*
* Example : X = Pack('013400')
* Y = UnPack(X)
* ? Y && 013400
*
FUNCTION CHAR UnPack_Str PROTOTYPE
PARAMS CONST CHAR
*******************
* Empty_Str(<CHAR>)
*
* test if the len of a string is 0 or only contains spaces
* This replaces if len(rtrim(ltrim(string))) = 0 to if empty_str(string)
*
FUNCTION LOGICAL Empty_Str PROTOTYPE
PARAMS CONST CHAR
*******************************
* AtNum(<CHAR>, <CHAR>, <UINT>)
*
* Determing the para 3 apperaence of para 2 in para 1
*
* Para 1 : String to search
* Para 2 : String to search with
* Para 3 : Appereance
*
FUNCTION UINT AtNum PROTOTYPE
PARAMS CONST CHAR, CONST CHAR, VALUE UINT
*************************************************
* StrTran(<CHAR>, <CHAR>, <CHAR>, <UINT>, <UINT>)
*
* Search and replace within a character string
*
* Para 1 : String to search
* Para 2 : String to locate
* Para 3 : String to replace with
* Para 4 : First occerence that will be replaced
* Para 5 : Number of occerences to replace
*
FUNCTION CHAR StrTran PROTOTYPE
PARAMS CONST CHAR, CONST CHAR, CONST CHAR, VALUE UINT, VALUE UINT
* eof - fc_str.hdr