Txt-Simple grep

From Vectorlab
Jump to: navigation, search


Function to return a string after replacing "\t" and "\r" with tabs and carriage returns. This is very useful for plug-in edit parameters, where you cannot enter a tab or a carriage return. This needs the routine T_SearchReplace to be loaded first. By Orso B. Schmid


{ Orso *********************************************** }
{ very basic grep operations }
FUNCTION T_SimpleGrep(aString: STRING): STRING;
	CONST
		cBR = Chr(13);	{ return }
		cTB = Chr(9);	{ tab }
	VAR 
		str : STRING;
		
	BEGIN
		str := aString;
		str := T_SearchReplace(str, '\t', cTB);
		str := T_SearchReplace(str, '\r', cBR);
		
		T_SimpleGrep := str;
	END;