Txt-Get longest string

From Vectorlab
Jump to: navigation, search

Function to return the longest string comparing to another. Run it in a loop to compare more strings. This is indispensable when you do dialogs, in order to calculate dialog or elements width. By Orso B. Schmid

{ Orso *********************************************** }
{ checks between two strings which one is the longest }
FUNCTION T_GetLongestStr(currStr, longestStr: STRING): STRING;
		T_GetLongestStr := longestStr;
		IF (Len(currStr) > Len(longestStr)) THEN
			T_GetLongestStr := currStr;