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 >
Text File  |  1991-06-20  |  5KB  |  200 lines

  1. #output Force Tools 1.2 - String functions
  2.  
  3. *
  4. * return the complement of a string for descending indexing
  5. *
  6. function char decsend prototype
  7.    params const char str
  8.  
  9. *
  10. * return soundex code for string
  11. *
  12. function char(4) soundex prototype
  13.    params const char str
  14.  
  15. *****************
  16. * AllTrim(<CHAR>)
  17. *
  18. * Return a string with leading and trailing
  19. * spaces removed
  20. *
  21. FUNCTION CHAR AllTrim PROTOTYPE
  22.    PARAMS CONST CHAR
  23.    
  24. *************************
  25. * StrZero(<LONG>, <UINT>)
  26. *
  27. * Convert numeric to string with
  28. * leading spaces
  29. * Para 2 : Number of digits to return
  30. *
  31. FUNCTION CHAR StrZero PROTOTYPE
  32.    PARAMS VALUE ULONG, VALUE UINT
  33.  
  34. *--- return a token from a search string
  35. function char token prototype
  36.    params const char search_str, const char token_list, value uint token_no
  37.  
  38. *--- return number of tokens in a search string
  39. function uint num_token prototype
  40.    params const char search_str, const char token_list
  41.    
  42. *--- return initial position of a token
  43. function uint at_token prototype
  44.    params const char search_str, const char token_list, value uint token_no
  45.  
  46. *************************
  47. * CharXor(<CHAR>, <CHAR>)
  48. *
  49. * Return the XOR of two strings (Encrypt / Decrypt)
  50. *
  51. * Para 1 : String to En(De)Crypt
  52. * Para 2 : String to XOR with
  53. *
  54. FUNCTION CHAR CharXor PROTOTYPE
  55.    PARAMS CONST CHAR, CONST CHAR
  56.    
  57. ***********************
  58. * Upper_AllTrim(<CHAR>)
  59. *
  60. * Uppercase and alltrim a string
  61. *
  62. FUNCTION CHAR Upper_AllTrim PROTOTYPE
  63.    PARAMS CONST CHAR
  64.    
  65. ***********************
  66. * Lower_AllTrim(<CHAR>)
  67. *
  68. * Lowercase and alltrim a string
  69. *
  70. FUNCTION CHAR Lower_AllTrim PROTOTYPE
  71.    PARAMS CONST CHAR
  72.  
  73. *********************
  74. * Pad(<CHAR>, <UINT>)
  75. *
  76. * Pad right with spaces
  77. *
  78. * Para 1 : String to pad
  79. * Para 2 : number of spaces to add
  80. *
  81. FUNCTION CHAR Pad PROTOTYPE
  82.    PARAMS CONST CHAR, VALUE UINT
  83.    
  84. **********************************
  85. * Pad_Left(<CHAR>, <UINT>, <BYTE>)
  86. *
  87. * Pad left with specified char
  88. *
  89. * Para 1 : String to pad
  90. * Para 2 : number of para 3 to pad with
  91. * Para 3 : char to pad with
  92. *
  93. FUNCTION CHAR Pad_Left PROTOTYPE
  94.    PARAMS CONST CHAR, VALUE UINT, VALUE BYTE
  95.    
  96. **********************************
  97. * Pad_Right(<CHAR>, <UINT>, <BYTE>)
  98. *
  99. * Pad right with specified char
  100. *
  101. * Para 1 : String to pad
  102. * Para 2 : number of para 3 to pad with
  103. * Para 3 : char to pad with
  104. *
  105. FUNCTION CHAR Pad_Right PROTOTYPE
  106.    PARAMS CONST CHAR, VALUE UINT, VALUE BYTE   
  107.  
  108. *********************
  109. * Rat(<CHAR>, <CHAR>)
  110. *
  111. * Search from the right for a char
  112. *
  113. * Para 1 : string to find
  114. * Para 2 : string to search
  115. *
  116. FUNCTION UINT Rat PROTOTYPE
  117.    PARAMS CONST CHAR, CONST CHAR
  118.    
  119. *************************
  120. * Ltoc(<LOGICAL>, <CHAR>)
  121. *
  122. * Convert logical to a char
  123. *
  124. * Para 1 : logical
  125. * Para 2 : char's to use, example 'YN'
  126. *          first char is for .t.
  127. *
  128. FUNCTION CHAR Ltoc PROTOTYPE
  129.    PARAMS VALUE LOGICAL, CONST CHAR
  130.    
  131. **************
  132. * Dtos(<DATE>)
  133. *
  134. * Convert date to a char YYYYMMDD
  135. *
  136. FUNCTION CHAR Dtos PROTOTYPE
  137.    PARAMS VALUE DATE
  138.       
  139. **************
  140. * Pack(<CHAR>)
  141. *
  142. * Pack a string containing numeric digits to
  143. * a special BCD like format resulting in half the len
  144. *
  145. * Example : X = Pack('01234567')    && Pack numeric digits
  146. *           ? LEN(x)                && 4
  147. *
  148. FUNCTION CHAR Pack_Str PROTOTYPE
  149.    PARAMS CONST CHAR
  150.    
  151. ****************
  152. * UnPack(<CHAR>)
  153. *
  154. * Unpack a packed string to the
  155. * orginal digits
  156. *
  157. * Example :   X = Pack('013400')
  158. *             Y = UnPack(X)
  159. *             ? Y                   && 013400
  160. *
  161. FUNCTION CHAR UnPack_Str PROTOTYPE
  162.    PARAMS CONST CHAR
  163.  
  164. *******************
  165. * Empty_Str(<CHAR>)
  166. *
  167. * test if the len of a string is 0 or only contains spaces
  168. * This replaces if len(rtrim(ltrim(string))) = 0 to if empty_str(string)
  169. *
  170. FUNCTION LOGICAL Empty_Str PROTOTYPE
  171.    PARAMS CONST CHAR
  172.    
  173. *******************************
  174. * AtNum(<CHAR>, <CHAR>, <UINT>)
  175. *
  176. * Determing the para 3 apperaence of para 2 in para 1
  177. *
  178. * Para 1 : String to search
  179. * Para 2 : String to search with
  180. * Para 3 : Appereance 
  181. *
  182. FUNCTION UINT AtNum PROTOTYPE
  183.    PARAMS CONST CHAR, CONST CHAR, VALUE UINT
  184.  
  185. *************************************************
  186. * StrTran(<CHAR>, <CHAR>, <CHAR>, <UINT>, <UINT>)
  187. *
  188. * Search and replace within a character string
  189. *
  190. * Para 1 : String to search
  191. * Para 2 : String to locate
  192. * Para 3 : String to replace with
  193. * Para 4 : First occerence that will be replaced
  194. * Para 5 : Number of occerences to replace
  195. *
  196. FUNCTION CHAR StrTran PROTOTYPE
  197.    PARAMS CONST CHAR, CONST CHAR, CONST CHAR, VALUE UINT, VALUE UINT
  198.    
  199. * eof - fc_str.hdr