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:
ALINES()to put the memo into an array of lines, then use traverse each array element, checking for the string with
ATC()if you aren’t case-sensitive
ADDBS(cpath)– Adds a backslash (if needed) to a path expression.
ALINES(ArrayName, cExpression [, lTrim])– Copies each line in a character expression to a corresponding row in an array.
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.
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.
ATLINE(cSearchExpression, cExpressionSearched)– Returns the line number of the first occurrence of a character expression within another character expression, counting from the first line.
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.
FILETOSTR(cFileName)Returns the contents of a file as a character string.
JUSTDRIVE(cPath)– Returns the drive letter from a complete path.
MEMLINES()Returns the number of lines in a memo field or character expression. Sensitive to
NORMALIZE(cExpression)Converts a character expression, supplied by a user, into a form that can be compared with Visual FoxPro function return values.
STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence[, nFlag]]]])Retrieves a string between two delimiters.
STRTOFILE((cExpression, cFileName [, lAdditive])Writes the contents of a character string to a file. See also
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.
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”)