Fox Pro String Functions


Carcase NOX
SUPER carcasele NOX - Vezi pret!

Asadar ai impresia ca sti “string handling” in FoxPro? Numeste 62 de functii si comenzi fara cele de conversie de tip data calendaristica… :)
Am extras dintr-un articol cateva functii mai putin folosite insa in anumite momente de foarte mare folos.

Am sa mentionez aici doar cele mai interesante:

  1. ALINES() to put the memo into an array of lines, then use traverse each array element, checking for the string with AT() or ATC() if you aren’t case-sensitive
  2. ADDBS(cpath) – Adds a backslash (if needed) to a path expression.
  3. ALINES(ArrayName, cExpression [, lTrim]) – Copies each line in a character expression to a corresponding row in an array.
  4. ATCC(cSearchExpression, cExpressionSearched [, nOccurrence]) – Returns the beginning numeric position of the first occurrence of a character expression within another character expression, without regard for the case of these two expressions.
  5. ATCLINE(cSearchExpression, cExpressionSearched) – Returns the line number of the first occurrence of a character expression within another character expression, without regard for the case (upper or lower) of the characters in either expression.
  6. ATLINE(cSearchExpression, cExpressionSearched) – Returns the line number of the first occurrence of a character expression within another character expression, counting from the first line.
  7. CHRTRAN((cSearchedExpression, cSearchExpression, cReplacementExpression) – Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.
  8. FILETOSTR(cFileName) Returns the contents of a file as a character string.
  9. JUSTDRIVE(cPath) – Returns the drive letter from a complete path.
  10. MEMLINES() Returns the number of lines in a memo field or character expression. Sensitive to SET MEMOWIDTH
  11. NORMALIZE(cExpression) Converts a character expression, supplied by a user, into a form that can be compared with Visual FoxPro function return values.
  12. STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence[, nFlag]]]]) Retrieves a string between two delimiters.
  13. STRTOFILE((cExpression, cFileName [, lAdditive]) Writes the contents of a character string to a file. See also FILETOSTR().
  14. STUFF(cExpression, nStartReplacement, nCharactersReplaced, cReplacement) Returns a character string created by replacing a specified number of characters in a character expression with another character expression.
  15. TXTWIDTH(cExpression,cFontName,nFontSize,cFontStyle) Returns the length of a character expression with respect to the average character width for a font. Sample? TXTWIDTH(“Hello World”,”Arial”,12,””) vs. TXTWIDTH(“Hello World”,”Courier New”,8,”B”

Restul le gasiti in help, prin referire (“See also”)

E-BODA Essential A200
Tableta E-BODA Essential A200 cu procesor Cortex A8 1.0GHz, 7 inch








Leave a Reply

Your email address will not be published. Required fields are marked *