X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_basic.pas;h=bd3f50e76b3f2049e0ce6d9b41d63db4da9c8cf8;hp=e5ef3d9c28acdff92c10e22ddf19ef8beb635e92;hb=d48e70deea1b12aaea9d0543dfe5f1bac9787177;hpb=a49e32f2040ac79644fabdfa629cd4fd4750c515 diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index e5ef3d9..bd3f50e 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -90,6 +90,7 @@ procedure SortSArray(var S: SSArray); function b_Text_Format(S: string): string; function b_Text_Unformat(S: string): string; function b_Text_Wrap(S: string; LineLen: Integer): string; +function b_Text_LineCount(S: string): Integer; var gmon_dbg_los_enabled: Boolean = true; @@ -1180,4 +1181,14 @@ begin Result := WrapText(S, ''#10, [#10, ' ', '-'], LineLen); end; +function b_Text_LineCount(S: string): Integer; +var + I: Integer; +begin + Result := IfThen(S = '', 0, 1); + for I := 1 to High(S) do + if S[I] = #10 then + Inc(Result); +end; + end.